diff options
author | Alan Modra <amodra@gmail.com> | 2020-09-02 10:29:21 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-09-02 16:30:43 +0930 |
commit | c77a6ef6109c10e999b33e8f762809701084109c (patch) | |
tree | c38e0192b831a6dc32dd6c2c10f8d1b186d6123d /gas/expr.c | |
parent | 01a6f9da644e52fbd644a8e8f58d58c0383118c8 (diff) | |
download | gdb-c77a6ef6109c10e999b33e8f762809701084109c.zip gdb-c77a6ef6109c10e999b33e8f762809701084109c.tar.gz gdb-c77a6ef6109c10e999b33e8f762809701084109c.tar.bz2 |
ubsan: expr.c:1725,1741 signed integer overflow
* expr.c (add_to_result, subtract_from_result): Use unsigned
addition and subtraction.
Diffstat (limited to 'gas/expr.c')
-rw-r--r-- | gas/expr.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1722,7 +1722,7 @@ add_to_result (expressionS *resultP, offsetT amount, int rhs_highbit) valueT ures = resultP->X_add_number; valueT uamount = amount; - resultP->X_add_number += amount; + resultP->X_add_number += uamount; 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 uamount = amount; - resultP->X_add_number -= amount; + resultP->X_add_number -= uamount; resultP->X_extrabit ^= rhs_highbit; |