Brad Lassey - bug 463561 - mkdepend crashes while compiling freetype, follow up push to js/src r=bsmedberg a191=beltzner
authorBrad Lassey <blassey@mozilla.com>
Fri, 23 Jan 2009 16:06:15 -0500
changeset 24696 be85c97ff23f1721380302f94c32e342a8ead202
parent 24695 b146d68c07188e153bf25c3fb4623e7df0567326
child 24697 d88305edf63de5c4706918030b046551100e89e4
push id1195
push userblassey@mozilla.com
push dateWed, 15 Apr 2009 14:31:00 +0000
reviewersbsmedberg
bugs463561
milestone1.9.1b4pre
Brad Lassey - bug 463561 - mkdepend crashes while compiling freetype, follow up push to js/src r=bsmedberg a191=beltzner
js/src/config/mkdepend/ifparser.c
--- a/js/src/config/mkdepend/ifparser.c
+++ b/js/src/config/mkdepend/ifparser.c
@@ -291,16 +291,18 @@ parse_product (IfParser *g, const char *
     switch (*cp) {
       case '*':
 	DO (cp = parse_product (g, cp + 1, &rightval));
 	*valp = (*valp * rightval);
 	break;
 
       case '/':
 	DO (cp = parse_product (g, cp + 1, &rightval));
+	if (rightval == 0)
+	  return CALLFUNC(g, handle_error) (g, cp, "0");
 	*valp = (*valp / rightval);
 	break;
 
       case '%':
 	DO (cp = parse_product (g, cp + 1, &rightval));
 	*valp = (*valp % rightval);
 	break;
     }