mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
Fix a bug in the MC asm parser evaluating expressions. It was treating:
A = 9 B = 3 * A - 2 * A + 1 as B = 3 * A - (2 * A + 1) rdar://13816516 llvm-svn: 181366
This commit is contained in:
parent
0e8a5b9d09
commit
4562d15159
@ -1092,7 +1092,7 @@ bool AsmParser::ParseBinOpRHS(unsigned Precedence, const MCExpr *&Res,
|
||||
MCBinaryExpr::Opcode Dummy;
|
||||
unsigned NextTokPrec = getBinOpPrecedence(Lexer.getKind(), Dummy);
|
||||
if (TokPrec < NextTokPrec) {
|
||||
if (ParseBinOpRHS(Precedence+1, RHS, EndLoc)) return true;
|
||||
if (ParseBinOpRHS(TokPrec+1, RHS, EndLoc)) return true;
|
||||
}
|
||||
|
||||
// Merge LHS and RHS according to operator.
|
||||
|
@ -45,6 +45,7 @@ k:
|
||||
check_expr 0 || 0, 0
|
||||
check_expr 1 + 2 < 3 + 4, 1
|
||||
check_expr 1 << 8 - 1, 128
|
||||
check_expr 3 * 9 - 2 * 9 + 1, 10
|
||||
|
||||
.set c, 10
|
||||
check_expr c + 1, 11
|
||||
|
Loading…
Reference in New Issue
Block a user