summaryrefslogtreecommitdiff
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-07-22 16:30:41 -0700
committerEric Anholt <eric@anholt.net>2010-07-22 16:34:36 -0700
commita0879b9dd438d78635f047cdd5ed4c72bc831b60 (patch)
treeb6794a1d303b316ac06cb185a07190578132a5b9 /src/glsl/ast_to_hir.cpp
parent432b787b29202301dbfc139c3289521b0bfc3dec (diff)
glsl2: Put side effects of the RHS of logic_or in the right branch.
Kind of missing the point to only do the side effects if the LHS evaluates as true. Fixes: glsl1-|| operator, short-circuit
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index c03206fd2e..98ea789249 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -898,7 +898,7 @@ ast_expression::hir(exec_list *instructions,
ir_if *const stmt = new(ctx) ir_if(op[0]);
instructions->push_tail(stmt);
- op[1] = this->subexpressions[1]->hir(&stmt->then_instructions, state);
+ op[1] = this->subexpressions[1]->hir(&stmt->else_instructions, state);
if (!op[1]->type->is_boolean() || !op[1]->type->is_scalar()) {
YYLTYPE loc = this->subexpressions[1]->get_location();