summaryrefslogtreecommitdiff
path: root/devel/m4/patches/patch-aa
blob: 6a0af43c4334d9e10684868c8cee29fc6323cbb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-aa,v 1.4 2007/05/24 21:51:47 dmcmahill Exp $

avoid the following incorrect behaviour.

% echo "eval(-2/2)" | gm4 -
2147483647

has been reported on bug-m4@gnu.org

--- src/eval.c.orig	2007-01-09 16:12:43.000000000 +0000
+++ src/eval.c
@@ -721,7 +721,7 @@ 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);
+	    *v1 = *v1 / v2;
 	  break;
 
 	case MODULO: