-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[X86AsmParser] IntelExpression: End of Statement should check for valid end state #95677
[X86AsmParser] IntelExpression: End of Statement should check for valid end state #95677
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
b64b17c
to
b5bf7c3
Compare
@llvm/pr-subscribers-mc @llvm/pr-subscribers-backend-x86 Author: None (v01dXYZ) ChangesThe following commit bfb7099 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 Fixes #94446 Full diff: https://github.com/llvm/llvm-project/pull/95677.diff 1 Files Affected:
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 6623106109316..d338607acbabe 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -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.
@@ -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;
|
b5bf7c3
to
d6e252c
Compare
FYI, linux CI fails because of a (flaky ?) lldb test with a timeout. |
d6e252c
to
c00cb20
Compare
I repush the same commit to relaunch the CI. If you know a way to relaunch a failed CI pipeline, I want to know it too. |
Ping |
AsmParser is shared by assembler and fronr-end. Could you add a |
Ping. I added the case from the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can refactor X86AsmParser::ParseIntelExpression
to avoid so much customized code. But it looks good as a quick fix.
I wonder if a customised |
TBH, I am not clear about the history. This is a good wish of myself. |
FYI I don't have merge rights. if you consider the patch good enough, could you merge it on my behalf ? I'll take a look at trying to replace some parts of the custom Expression Parser by the generic AsmParser at the beginning of next month as it is an interesting task about a very specific part of LLVM (thus perfect for a beginner like me). The code I'll write won't matter as much as the documentation about the suggestions. |
Sure. |
@v01dXYZ Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/1904 Here is the relevant piece of the build log for the reference:
|
…id end state (#95677) Summary: The following commit bfb7099 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. Fixes #94446 --------- Co-authored-by: v01dxyz <[email protected]> Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251503
The following commit bfb7099 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.Fixes #94446