[llvm] [AArch64][AsmParser] Stop parsing on error (PR #106804)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 14:49:08 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

Fixes buffer overflow after #<!-- -->106625


---
Full diff: https://github.com/llvm/llvm-project/pull/106804.diff


1 Files Affected:

- (modified) llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index 34c0fad45fc499..373f844b239081 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -6995,7 +6995,7 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) {
     });
 
     if (It == std::end(ExtensionMap))
-      Error(CurLoc, "unsupported architectural extension: " + Name);
+      return Error(CurLoc, "unsupported architectural extension: " + Name);
 
     if (EnableFeature)
       STI.SetFeatureBitsTransitively(It->Features);

``````````

</details>


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


More information about the llvm-commits mailing list