[Mesa-dev] [PATCH] glsl: replace null check with assert

Timothy Arceri t_arceri at yahoo.com.au
Tue Jul 14 06:30:27 PDT 2015


This was added in 54f583a20 since then error handling has improved.

The test this was added to fix now fails earlier since 01822706ec
---
 src/glsl/ir_constant_expression.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 171b8e9..5732867 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -1857,9 +1857,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) {
-- 
2.4.3



More information about the mesa-dev mailing list