bug 463561 - mkdepend crashes while compiling freetype r=bsmedberg a191=beltzner
authorBrad Lassey <blassey@mozilla.com>
Fri, 23 Jan 2009 14:30:07 -0500
changeset 24695 b146d68c07188e153bf25c3fb4623e7df0567326
parent 24694 741f5b92be328bd2244a95813d3ee0701f12b4ef
child 24696 be85c97ff23f1721380302f94c32e342a8ead202
push id1195
push userblassey@mozilla.com
push dateWed, 15 Apr 2009 14:31:00 +0000
reviewersbsmedberg
bugs463561
milestone1.9.1b4pre
bug 463561 - mkdepend crashes while compiling freetype r=bsmedberg a191=beltzner
config/mkdepend/ifparser.c
--- a/config/mkdepend/ifparser.c
+++ b/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;
     }