[clang] [llvm] [clang] Fix encoding handling of asm strings (PR #169803)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 22:02:32 PST 2026


================
@@ -1391,8 +1391,22 @@ StringLiteral::getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
     unsigned TokNumBytes = SLP.GetStringLength();
 
     // If the byte is in this token, return the location of the byte.
-    if (ByteNo < TokNumBytes ||
-        (ByteNo == TokNumBytes && TokNo == getNumConcatenated() - 1)) {
+    //
+    // The string data may have been converted to a different encoding (e.g.
----------------
hubert-reinterpretcast wrote:

This should say "encoded into" instead of "converted to".

https://github.com/llvm/llvm-project/pull/169803


More information about the cfe-commits mailing list