glsl: replace null check with assert
authorTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 14 Jul 2015 13:30:27 +0000 (23:30 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 7 Jan 2016 22:12:45 +0000 (09:12 +1100)
This was added in 54f583a20 since then error handling has improved.

The test this was added to fix now fails earlier since 01822706ec

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ir_constant_expression.cpp

index 5bf5ce54f78d58ed0a752f2eb1a05485133dfeaa..f02e959bd18f36bb70fbb2496de6eebc9ccce146 100644 (file)
@@ -1824,9 +1824,7 @@ ir_swizzle::constant_expression_value(struct hash_table *variable_context)
 ir_constant *
 ir_dereference_variable::constant_expression_value(struct hash_table *variable_context)
 {
-   /* This may occur during compile and var->type is glsl_type::error_type */
-   if (!var)
-      return NULL;
+   assert(var);
 
    /* Give priority to the context hashtable, if it exists */
    if (variable_context) {