Skip to content

Commit

Permalink
Fix bug #67111
Browse files Browse the repository at this point in the history
Loop variables need to be freed for both "break" and "continue".

I'm adding the test to Zend/ because it's good to have a test for
this even without opcache.
  • Loading branch information
nikic committed Dec 19, 2014
1 parent 75d9959 commit 097cee8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Optimizer/pass2.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
jmp_to = &op_array->brk_cont_array[array_offset];
array_offset = jmp_to->parent;
if (--nest_levels > 0) {
if (opline->opcode == ZEND_BRK &&
(op_array->opcodes[jmp_to->brk].opcode == ZEND_FREE ||
op_array->opcodes[jmp_to->brk].opcode == ZEND_SWITCH_FREE)) {
if (op_array->opcodes[jmp_to->brk].opcode == ZEND_FREE ||
op_array->opcodes[jmp_to->brk].opcode == ZEND_SWITCH_FREE
) {
dont_optimize = 1;
break;
}
Expand Down

0 comments on commit 097cee8

Please sign in to comment.