mojoshader_preprocessor.c
changeset 746 6b368eeaa3fc
parent 729 92cc053fbf75
child 748 818ae6582f24
--- a/mojoshader_preprocessor.c	Thu Apr 09 01:54:52 2009 -0400
+++ b/mojoshader_preprocessor.c	Thu Apr 09 03:50:06 2009 -0400
@@ -1232,15 +1232,17 @@
                         paren++;
                     else if (t == ')')
                     {
-                        if (i != def->paramcount-1)
+                        assert(paren >= 0);
+                        if (paren == 0)
                         {
-                            fail(ctx, "Too few macro arguments");
-                            goto handle_pp_identifier_failed;
+                            if (i != def->paramcount-1)
+                            {
+                                fail(ctx, "Too few macro arguments");
+                                goto handle_pp_identifier_failed;
+                            } // if
+                            break;
                         } // if
 
-                        if (paren == 0)
-                            break;
-
                         paren--;
                     } // else if
                     else if (t == ',')