diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-12-01 15:33:56 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-12-09 16:42:05 -0800 |
commit | 13c45c590b69341487acf21f339bf1e502eedee6 (patch) | |
tree | a16276002e4996646440e1754fe898257cd6477d /src/glsl | |
parent | 528fa8ce329c22d6376d075c2afa69f177423bfa (diff) | |
download | external_mesa3d-13c45c590b69341487acf21f339bf1e502eedee6.zip external_mesa3d-13c45c590b69341487acf21f339bf1e502eedee6.tar.gz external_mesa3d-13c45c590b69341487acf21f339bf1e502eedee6.tar.bz2 |
glsl: Consider the "else" branch when looking for loop breaks.
Found this bug by code inspection. Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch. However, the code actually looked at the
last instruction in the "then" branch twice.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/loop_unroll.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/loop_unroll.cpp b/src/glsl/loop_unroll.cpp index 4e6acda..c5001ba 100644 --- a/src/glsl/loop_unroll.cpp +++ b/src/glsl/loop_unroll.cpp @@ -104,7 +104,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) if (is_break(last)) { continue_from_then_branch = false; } else { - last = (ir_instruction *) last_if->then_instructions.get_tail(); + last = (ir_instruction *) last_if->else_instructions.get_tail(); if (is_break(last)) continue_from_then_branch = true; |