[clang] [clang] Fix handling of asm string literals (PR #169803)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 7 19:42:22 PST 2026
================
@@ -245,6 +249,18 @@ ExprResult Sema::ActOnGCCAsmStmtString(Expr *Expr, bool ForAsmLabel) {
Diag(Expr->getBeginLoc(), diag::err_asm_operand_empty_string)
<< SL->getSourceRange();
}
+
+ if (!IsConstexpr &&
+ PP.getTextEncoding().getFromIBM1047Converter() != nullptr) {
+ SmallString<16> ConvertedAsm;
+ PP.getTextEncoding().getFromIBM1047Converter()->convert(SL->getString(),
+ ConvertedAsm);
----------------
hubert-reinterpretcast wrote:
Please add an assertion that the conversion did not fail with an explanation that this conversion always succeeds.
https://github.com/llvm/llvm-project/pull/169803
More information about the cfe-commits
mailing list