-
Notifications
You must be signed in to change notification settings - Fork 13.5k
MIPS: Adding a check for JAL argument in PIC mode to prevent crashing on getExpr #120356
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
Conversation
|
@wzssyqa could you please take a look? |
@@ -2108,6 +2108,10 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc, | |||
if ((Opcode == Mips::JAL || Opcode == Mips::JAL_MM) && inPicMode()) { | |||
warnIfNoMacro(IDLoc); | |||
|
|||
if (!Inst.getOperand(0).isExpr()) { | |||
return Error(IDLoc, "jal needs a symbolic expression in PIC mode"); |
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.
gas gives the error message like:
k.s: Assembler messages:
k.s:2: Error: unsupported constant in relocation
I think that we should keep them same.
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.
sounds good, updated to the same message, thank you!
@wzssyqa please take a look, I should have resolved your comment, thank you! |
Thanks for your work. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/13621 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/10659 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/10254 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/10530 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/11872 Here is the relevant piece of the build log for the reference
|
Only an Expr is supported by JAL.
Let's check it before getExpr.
#80535