Skip to content

Commit

Permalink
[X86AsmParser] IntelExpression: Check for valid end state on EndOfSta…
Browse files Browse the repository at this point in the history
…tement

Fixes #94446
  • Loading branch information
v01dxyz committed Jun 18, 2024
1 parent 2eb60e2 commit b5bf7c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ class X86AsmParser : public MCTargetAsmParser {
unsigned getLength() const { return CurType.Length; }
int64_t getImm() { return Imm + IC.execute(); }
bool isValidEndState() const {
return State == IES_RBRAC || State == IES_INTEGER;
return State == IES_RBRAC || State == IES_RPAREN ||
State == IES_INTEGER || State == IES_REGISTER;
}

// Is the intel expression appended after an operand index.
Expand Down Expand Up @@ -1897,9 +1898,6 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
case AsmToken::Error:
return Error(getLexer().getErrLoc(), getLexer().getErr());
break;
case AsmToken::EndOfStatement:
Done = true;
break;
case AsmToken::Real:
// DotOperator: [ebx].0
UpdateLocLex = false;
Expand Down

0 comments on commit b5bf7c3

Please sign in to comment.