[llvm] [MC] AsmLexer invalid read fix. (PR #154972)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 22:35:30 PDT 2025


================
@@ -878,7 +878,16 @@ AsmToken AsmLexer::LexToken() {
   case ' ':
   case '\t':
     IsAtStartOfStatement = OldIsAtStartOfStatement;
-    while (*CurPtr == ' ' || *CurPtr == '\t')
+#ifdef LLVM_DEBUG
----------------
MaskRay wrote:

No need to use LLVM_DEBUG or write the lengthy comment about [] operator.

LLVM_USE_SANITIZER=Address builds would catch this issue with the new test case.

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


More information about the llvm-commits mailing list