[llvm] [X86AsmParser] IntelExpression: End of Statement should check for valid end state (PR #95677)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 15 11:42:25 PDT 2024


https://github.com/v01dXYZ created https://github.com/llvm/llvm-project/pull/95677

The following commit bfb7099eeb9b6f62510b1db0cb93a8c3cfa68236 added a special case for End of Statement that doesn't check if the state machine is rightfully in a state where ending is valid.

This PR suggest to revert this change to make `EndOfStatement` processed as any other tokens that are not consumable by the state machine.

>From b64b17c3d77e25262c44267b8625597c22061fed Mon Sep 17 00:00:00 2001
From: v01dxyz <v01dxyz at v01d.xyz>
Date: Sat, 15 Jun 2024 20:20:46 +0200
Subject: [PATCH] TMP: [X86AsmParser] IntelExpression: Check for valid end
 state on EndOfStatement

warning:

* Even if this change is valid, new test cases have to be added
* no QA done yet, on its way

Fixes https://github.com/llvm/llvm-project/issues/94446
---
 llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 6623106109316..8fc4467b88dcf 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1897,9 +1897,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;



More information about the llvm-commits mailing list