aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-07-28 12:34:30 +0200
committerJan Beulich <jbeulich@suse.com>2023-07-28 12:34:30 +0200
commit95b83567a4500c9cc14480dc171cf1d26a1555a6 (patch)
treee9a22565fba15fbc4b43686b3cc602773fc3edca /gas/read.c
parent29c108c9610640439daa5244a573348b7c47d994 (diff)
downloadgdb-95b83567a4500c9cc14480dc171cf1d26a1555a6.zip
gdb-95b83567a4500c9cc14480dc171cf1d26a1555a6.tar.gz
gdb-95b83567a4500c9cc14480dc171cf1d26a1555a6.tar.bz2
gas: amend X_unsigned uses
PR gas/30688 X_unsigned being clear does not indicate a negative number; it merely indicates a signed one (whose sign may still be clear). Amend two uses by an actual value check.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/read.c b/gas/read.c
index 0cceca8..826156d 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1751,7 +1751,7 @@ s_comm_internal (int param,
ignore_rest_of_line ();
goto out;
}
- else if (temp != size || !exp.X_unsigned)
+ else if (temp != size || (!exp.X_unsigned && exp.X_add_number < 0))
{
as_warn (_("size (%ld) out of range, ignored"), (long) temp);
ignore_rest_of_line ();
@@ -2541,7 +2541,7 @@ parse_align (int align_bytes)
if (exp.X_op == O_absent)
goto no_align;
- if (!exp.X_unsigned)
+ if (!exp.X_unsigned && exp.X_add_number < 0)
{
as_warn (_("alignment negative; 0 assumed"));
align = 0;