Browse Source
Drop FREE_ON_RETURN flag, check brk_cont->start instead
Drop FREE_ON_RETURN flag, check brk_cont->start instead
Start >= 0 already tells us whether or not the loop has a loop variable, no need to add extra flags to opcodes. Also added a test for a case where FREE_ON_RETURN is relevant, we didn't seem to have any coverage for this.pull/1289/merge
6 changed files with 40 additions and 54 deletions
-
16Zend/tests/loop_free_on_return.phpt
-
10Zend/zend_compile.c
-
2Zend/zend_compile.h
-
16Zend/zend_execute.c
-
25Zend/zend_vm_def.h
-
25Zend/zend_vm_execute.h
@ -0,0 +1,16 @@ |
|||
--TEST-- |
|||
Break out of while loop that is followed by a return statement and inside a foreach loop |
|||
--FILE-- |
|||
<?php |
|||
|
|||
$a = [42]; |
|||
foreach ($a as $b) { |
|||
while (1) { |
|||
break 2; |
|||
} |
|||
return; |
|||
} |
|||
?> |
|||
===DONE=== |
|||
--EXPECT-- |
|||
===DONE=== |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue