summaryrefslogtreecommitdiff
path: root/glsl_types.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-03-28 01:24:55 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-29 12:48:45 -0700
commitab372dab2a013e5d0c8ee57bb799a76c9a78abf2 (patch)
treeb0fc9b64c28368ca968c57e2e4e9f60b17a7b935 /glsl_types.cpp
parent2e063f1adf9e529697483eaabc7e015b4b740267 (diff)
Reject main() declarations with a non-void return value.
Fixes main3.vert.
Diffstat (limited to 'glsl_types.cpp')
-rw-r--r--glsl_types.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/glsl_types.cpp b/glsl_types.cpp
index 55d960320d..df9667f8dc 100644
--- a/glsl_types.cpp
+++ b/glsl_types.cpp
@@ -489,10 +489,12 @@ _mesa_glsl_initialize_constructors(exec_list *instructions,
const glsl_type *
glsl_type::get_instance(unsigned base_type, unsigned rows, unsigned columns)
{
+ if (base_type == GLSL_TYPE_VOID)
+ return &void_type;
+
if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
return error_type;
-
/* Treat GLSL vectors as Nx1 matrices.
*/
if (columns == 1) {