Fixed logic in error reporting on ambiguous function calls.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 10 Feb 2011 22:20:04 -0500
changeset 993 426ab31f27d1
parent 992 a951ce8bf2ec
child 994 561ee5138f4e
Fixed logic in error reporting on ambiguous function calls.
mojoshader_compiler.c
--- a/mojoshader_compiler.c	Thu Feb 10 18:52:50 2011 -0500
+++ b/mojoshader_compiler.c	Thu Feb 10 22:20:04 2011 -0500
@@ -2365,11 +2365,12 @@
 
         if (this_match)
         {
-            if (match++ == 0)
+            match++;
+            if (match == 1)
                 best = item;
             else
             {
-                if (match++ == 1)
+                if (match == 2)
                     failf(ctx, "Ambiguous function call to '%s'", sym);
                 // !!! FIXME: list each possible function in a fail() here.
             } // else