[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 1.4.9: wrong results in signed division
From: |
Cesar Strauss |
Subject: |
Re: 1.4.9: wrong results in signed division |
Date: |
Sat, 21 Apr 2007 20:46:51 -0300 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070306) |
Sorry, the mailer changed the whitespace in the patch. Trying to attach
it this time.
2007-04-21 Cesar Strauss <address@hidden> (tiny change)
* src/eval.c (mult_term): Avoids casting the operands to unsigned
in division. Fixes regression introduced in 2007-01-06.
Regards,
Cesar
Index: src/eval.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/eval.c,v
retrieving revision 1.1.1.1.2.9
diff -u -3 -p -r1.1.1.1.2.9 eval.c
--- src/eval.c 9 Jan 2007 16:12:43 -0000 1.1.1.1.2.9
+++ src/eval.c 21 Apr 2007 18:56:27 -0000
@@ -721,7 +721,9 @@ mult_term (eval_token et, int32_t *v1)
/* Avoid the x86 SIGFPE on INT_MIN / -1. */
*v1 = (int32_t) -(uint32_t) *v1;
else
- *v1 = (int32_t) ((uint32_t) *v1 / (uint32_t) v2);
+ /* Casting to unsigned would give wrong results here.
+ There is no danger of overflow in this case, anyway. */
+ *v1 = *v1 / v2;
break;
case MODULO: