[PATCH] D57375: X86AsmParser AVX-512: Return error instead of hitting assert
Brandon Jones via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 11 03:12:46 PST 2019
BrandonTJones updated this revision to Diff 186213.
BrandonTJones added a comment.
Added test case.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57375/new/
https://reviews.llvm.org/D57375
Files:
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/test/MC/X86/avx512-err.s
Index: llvm/test/MC/X86/avx512-err.s
===================================================================
--- llvm/test/MC/X86/avx512-err.s
+++ llvm/test/MC/X86/avx512-err.s
@@ -11,3 +11,6 @@
// ERR: invalid operand for instruction
cvtsd2sil {rn-sae}, %xmm1, %eax
+
+// ERR: Expected an identifier after {
+cvtsd2sil {{sae}, %xmm1, %eax
Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1655,6 +1655,8 @@
const AsmToken &Tok = Parser.getTok();
// Eat "{" and mark the current place.
const SMLoc consumedToken = consumeToken();
+ if (Tok.isNot(AsmToken::Identifier))
+ return ErrorOperand(Tok.getLoc(), "Expected an identifier after {");
if (Tok.getIdentifier().startswith("r")){
int rndMode = StringSwitch<int>(Tok.getIdentifier())
.Case("rn", X86::STATIC_ROUNDING::TO_NEAREST_INT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57375.186213.patch
Type: text/x-patch
Size: 993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190211/715bf995/attachment.bin>
More information about the llvm-commits
mailing list