Sorry, the mailer changed the whitespace in the patch. Trying to attach
 it this time.

2007-04-21  Cesar Strauss  <[EMAIL PROTECTED]> (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:
_______________________________________________
Bug-m4 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-m4

Reply via email to