diff --git a/clang/lib/AST/ByteCode/Disasm.cpp b/clang/lib/AST/ByteCode/Disasm.cpp index ac904d359d8cc..ab3b9f7c3b1d7 100644 --- a/clang/lib/AST/ByteCode/Disasm.cpp +++ b/clang/lib/AST/ByteCode/Disasm.cpp @@ -44,7 +44,20 @@ inline static std::string printArg(Program &P, CodePtr &OpPC) { std::string Result; llvm::raw_string_ostream SS(Result); auto Arg = OpPC.read(); - SS << Arg; + // Make sure we print the integral value of chars. + if constexpr (std::is_integral_v) { + if constexpr (sizeof(T) == 1) { + if constexpr (std::is_signed_v) + SS << static_cast(Arg); + else + SS << static_cast(Arg); + } else { + SS << Arg; + } + } else { + SS << Arg; + } + return Result; } }