glsl: Fix inverted conditional in error message.
authorMatt Turner <mattst88@gmail.com>
Mon, 10 Jun 2013 20:28:40 +0000 (13:28 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 12 Jul 2013 03:58:58 +0000 (20:58 -0700)
The code float a[2] = float[2]( 3.4, 4.2, 5.0 ); previously generated
this:

   error: array constructor must have at least 2 parameters

when in fact it requires exactly two.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
src/glsl/ast_function.cpp

index 086023854349385113d7d3e8f80d3c69c9352f8c..4b0b87351f53e9a4513db0e3042f4015473f1b4c 100644 (file)
@@ -648,7 +648,7 @@ process_array_constructor(exec_list *instructions,
 
       _mesa_glsl_error(loc, state, "array constructor must have %s %u "
                       "parameter%s",
-                      (constructor_type->length != 0) ? "at least" : "exactly",
+                      (constructor_type->length == 0) ? "at least" : "exactly",
                       min_param, (min_param <= 1) ? "" : "s");
       return ir_rvalue::error_value(ctx);
    }