aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2025-01-17 17:57:48 +1030
committerAlan Modra <amodra@gmail.com>2025-01-17 19:06:39 +1030
commit1897dad5d755c0a0c0a9a3a294576add7d5c2280 (patch)
treedac040e875923d02c39129d8387d8a8fde7412fc
parentd7a3c9e650240e9e1c8e66e9099dc2880840a919 (diff)
downloadgdb-1897dad5d755c0a0c0a9a3a294576add7d5c2280.zip
gdb-1897dad5d755c0a0c0a9a3a294576add7d5c2280.tar.gz
gdb-1897dad5d755c0a0c0a9a3a294576add7d5c2280.tar.bz2
Silence asan warnings in resolve_symbol_value
The ".quad with division (fwdref)" gas test fails with asan warning negation of -9223372036854775808 cannot be represented in type 'long int' Fix this and another similar case. * symbols.c (resolve_symbol_value): Cast "left" to valueT before negating.
-rw-r--r--gas/symbols.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 37a1e2b..14e6018 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -1596,7 +1596,7 @@ resolve_symbol_value (symbolS *symp)
final_seg = absolute_section;
if (op == O_uminus)
- left = -left;
+ left = -(valueT) left;
else if (op == O_logical_not)
left = !left;
else
@@ -1730,7 +1730,7 @@ resolve_symbol_value (symbolS *symp)
break;
if (right == -1)
{
- left = -left;
+ left = -(valueT) left;
break;
}
left /= right;