Check against division by zero for the modula operator. This fixes header
authorJohan Dahlin <johan@gnome.org>
Fri, 24 Oct 2008 09:17:02 +0000 (09:17 +0000)
committerJohan Dahlin <johan@src.gnome.org>
Fri, 24 Oct 2008 09:17:02 +0000 (09:17 +0000)
2008-10-24  Johan Dahlin  <johan@gnome.org>

        * giscanner/scannerparser.y:
        Check against division by zero for the modula operator.
        This fixes header parsing of OSX system headers included
        by libsoup.

svn path=/trunk/; revision=804

ChangeLog
giscanner/scannerparser.y

index 553e676..ee359c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-10-24  Johan Dahlin  <johan@gnome.org>
 
+       * giscanner/scannerparser.y:
+       Check against division by zero for the modula operator.
+       This fixes header parsing of OSX system headers included
+       by libsoup.
+
+2008-10-24  Johan Dahlin  <johan@gnome.org>
+
        * CONTRIBUTORS:
        * Makefile.am:
        Add a CONTRIBUTORS file and dist it.
index 21151bd..e3ca20e 100644 (file)
@@ -352,7 +352,9 @@ multiplicative_expression
          {
                $$ = gi_source_symbol_new (CSYMBOL_TYPE_CONST);
                $$->const_int_set = TRUE;
-               $$->const_int = $1->const_int % $3->const_int;
+               if ($3->const_int != 0) {
+                       $$->const_int = $1->const_int % $3->const_int;
+               }
          }
        ;