Mesa (master): glsl: Don't return NULL IR for erroneous bit-shift operators .

Kenneth Graunke kwg at kemper.freedesktop.org
Mon Oct 18 07:29:18 UTC 2010


Module: Mesa
Branch: master
Commit: b8276e46f593fd9d938258636a2ba4452d895338
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8276e46f593fd9d938258636a2ba4452d895338

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Oct 18 00:24:46 2010 -0700

glsl: Don't return NULL IR for erroneous bit-shift operators.

Existing code relies on IR being generated (possibly with error type)
rather than returning NULL.  So, don't break - go ahead and generate the
operation.  As long as an error is flagged, things will work out.

Fixes fd.o bug #30914.

---

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

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index b37fcbd..a46d690 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -752,7 +752,6 @@ ast_expression::hir(exec_list *instructions,
           _mesa_glsl_error(&loc, state, "operator %s requires GLSL 1.30",
               operator_string(this->oper));
           error_emitted = true;
-          break;
        }
 
        /* From page 50 (page 56 of the PDF) of the GLSL 1.30 spec:
@@ -774,21 +773,18 @@ ast_expression::hir(exec_list *instructions,
                "LHS of operator %s must be an integer or integer vector",
                operator_string(this->oper));
            error_emitted = true;
-           break;
        }
        if (!op[1]->type->is_integer()) {
            _mesa_glsl_error(& loc, state,
                "RHS of operator %s must be an integer or integer vector",
                operator_string(this->oper));
            error_emitted = true;
-           break;
        }
        if (op[0]->type->is_scalar() && !op[1]->type->is_scalar()) {
            _mesa_glsl_error(& loc, state,
                "If the first operand of %s is scalar, the second must be"
                "scalar as well", operator_string(this->oper));
            error_emitted = true;
-           break;
        }
        if (op[0]->type->is_vector() &&
            op[1]->type->is_vector() &&
@@ -798,7 +794,6 @@ ast_expression::hir(exec_list *instructions,
                "Vector operands of %s must have same number of components",
                operator_string(this->oper));
            error_emitted = true;
-           break;
        }
 
        type = op[0]->type;




More information about the mesa-commit mailing list