Mesa (7.9): glsl: Fix ir_expression::constant_expression_value()

Ian Romanick idr at kemper.freedesktop.org
Wed Dec 15 22:06:30 UTC 2010


Module: Mesa
Branch: 7.9
Commit: 0da1c7b90fe01cdd1672fc65f118bff6c6a82878
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0da1c7b90fe01cdd1672fc65f118bff6c6a82878

Author: Chad Versace <chad.versace at intel.com>
Date:   Mon Nov  8 17:30:13 2010 -0800

glsl: Fix ir_expression::constant_expression_value()

When the type of the ir_expression is error_type, return NULL.
This fixes bug 31371.
(cherry picked from commit b62c1c4595551c4936323135224a5ea686ba972a)

---

 src/glsl/ir_constant_expression.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 61a708f..bab7466 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -54,6 +54,9 @@ dot(ir_constant *op0, ir_constant *op1)
 ir_constant *
 ir_expression::constant_expression_value()
 {
+   if (this->type->is_error())
+      return NULL;
+
    ir_constant *op[2] = { NULL, NULL };
    ir_constant_data data;
 




More information about the mesa-commit mailing list