mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 16:05:56 +08:00
ubsan: expr.c:1725,1741 signed integer overflow
* expr.c (add_to_result, subtract_from_result): Use unsigned addition and subtraction.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2020-09-02 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* expr.c (add_to_result, subtract_from_result): Use unsigned
|
||||||
|
addition and subtraction.
|
||||||
|
|
||||||
2020-09-02 Alan Modra <amodra@gmail.com>
|
2020-09-02 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* config/tc-z80.c (is_overflow): Avoid too large shift.
|
* config/tc-z80.c (is_overflow): Avoid too large shift.
|
||||||
|
@ -1722,7 +1722,7 @@ add_to_result (expressionS *resultP, offsetT amount, int rhs_highbit)
|
|||||||
valueT ures = resultP->X_add_number;
|
valueT ures = resultP->X_add_number;
|
||||||
valueT uamount = amount;
|
valueT uamount = amount;
|
||||||
|
|
||||||
resultP->X_add_number += amount;
|
resultP->X_add_number += uamount;
|
||||||
|
|
||||||
resultP->X_extrabit ^= rhs_highbit;
|
resultP->X_extrabit ^= rhs_highbit;
|
||||||
|
|
||||||
@ -1738,7 +1738,7 @@ subtract_from_result (expressionS *resultP, offsetT amount, int rhs_highbit)
|
|||||||
valueT ures = resultP->X_add_number;
|
valueT ures = resultP->X_add_number;
|
||||||
valueT uamount = amount;
|
valueT uamount = amount;
|
||||||
|
|
||||||
resultP->X_add_number -= amount;
|
resultP->X_add_number -= uamount;
|
||||||
|
|
||||||
resultP->X_extrabit ^= rhs_highbit;
|
resultP->X_extrabit ^= rhs_highbit;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user