[PATCH] D151652: [ms-inline asm] Add error check for `getAsInteger`
Phoebe Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 29 20:21:15 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8f386ff69ab8: [ms-inline asm] Add error check for `getAsInteger` (authored by pengfei).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151652/new/
https://reviews.llvm.org/D151652
Files:
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2315,7 +2315,8 @@
// .Imm gets lexed as a real.
if (Tok.is(AsmToken::Real)) {
APInt DotDisp;
- DotDispStr.getAsInteger(10, DotDisp);
+ if (DotDispStr.getAsInteger(10, DotDisp))
+ return Error(Tok.getLoc(), "Unexpected offset");
Info.Offset = DotDisp.getZExtValue();
} else if ((isParsingMSInlineAsm() || getParser().isParsingMasm()) &&
Tok.is(AsmToken::Identifier)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151652.526502.patch
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230530/529c2b84/attachment.bin>
More information about the llvm-commits
mailing list