From: Eric Anholt Date: Thu, 22 Jul 2010 23:30:41 +0000 (-0700) Subject: glsl2: Put side effects of the RHS of logic_or in the right branch. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0879b9dd438d78635f047cdd5ed4c72bc831b60;p=mesa.git 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 --- diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index c03206fd2e5..98ea789249d 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();