From 10affaf894a72bee9b84ada77dc943b1bb03d02e Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Fri, 30 Aug 2024 14:50:51 -0700 Subject: [PATCH] [AArch64][AsmParser] Stop parsing on error (#106804) Fixes buffer overflow after #106625 --- llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);