From ceac3f627118f6e5933d38a6726a104bdbd6d7de Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 7 Jan 2002 17:51:18 +0000 Subject: [PATCH] do not allow size or nbytes to go negative. --- gas/ChangeLog | 5 +++++ gas/read.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 5d5ece9a46d..77f16283c29 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2002-01-07 Nick Clifton + + * read.c (emit_expr): Do not allow 'size' or 'nbytes' to go + negative. + 2002-01-06 Alan Modra * config/tc-m68k.h (md_prepare_relax_scan): Rewrite. diff --git a/gas/read.c b/gas/read.c index 5fc9511314d..b0446c8d13c 100644 --- a/gas/read.c +++ b/gas/read.c @@ -3683,7 +3683,7 @@ emit_expr (exp, nbytes) } nums = generic_bignum + size / CHARS_PER_LITTLENUM; - while (size > 0) + while (size >= CHARS_PER_LITTLENUM) { --nums; md_number_to_chars (p, (valueT) *nums, CHARS_PER_LITTLENUM); @@ -3694,7 +3694,7 @@ emit_expr (exp, nbytes) else { nums = generic_bignum; - while (size > 0) + while (size >= CHARS_PER_LITTLENUM) { md_number_to_chars (p, (valueT) *nums, CHARS_PER_LITTLENUM); ++nums; @@ -3703,7 +3703,7 @@ emit_expr (exp, nbytes) nbytes -= CHARS_PER_LITTLENUM; } - while (nbytes > 0) + while (nbytes >= CHARS_PER_LITTLENUM) { md_number_to_chars (p, extra_digit, CHARS_PER_LITTLENUM); nbytes -= CHARS_PER_LITTLENUM; -- 2.30.2