mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
gas: avoid UB on signed multiplication in resolve_symbol_value()
Commit 487b0ff02d
("ubsan: signed integer multiply overflow") touched
only one of the two affected places (the 3rd, resolve_expression(), is
already using valueT type local variables).
This commit is contained in:
parent
a21e2f0c20
commit
bbe22ca078
@ -1721,7 +1721,8 @@ resolve_symbol_value (symbolS *symp)
|
||||
|
||||
switch (symp->x->value.X_op)
|
||||
{
|
||||
case O_multiply: left *= right; break;
|
||||
/* See expr() for reasons of the use of valueT casts here. */
|
||||
case O_multiply: left *= (valueT) right; break;
|
||||
case O_divide: left /= right; break;
|
||||
case O_modulus: left %= right; break;
|
||||
case O_left_shift:
|
||||
|
Loading…
Reference in New Issue
Block a user