Browse Source
Fixed bugs #34065 and #38623 (throw in foreach/switch causes memory leaks)
PECL_OPENSSL
Fixed bugs #34065 and #38623 (throw in foreach/switch causes memory leaks)
PECL_OPENSSL
7 changed files with 100 additions and 16 deletions
-
3NEWS
-
15Zend/tests/bug34065.phpt
-
16Zend/tests/bug38623.phpt
-
1Zend/zend_compile.c
-
1Zend/zend_compile.h
-
40Zend/zend_vm_def.h
-
40Zend/zend_vm_execute.h
@ -0,0 +1,15 @@ |
|||
--TEST-- |
|||
Bug #34065 (throw in foreach causes memory leaks) |
|||
--FILE-- |
|||
<?php |
|||
$data = file(__FILE__); |
|||
try { |
|||
foreach ($data as $line) { |
|||
throw new Exception("error"); |
|||
} |
|||
} catch (Exception $e) { |
|||
echo "ok\n"; |
|||
} |
|||
?> |
|||
--EXPECT-- |
|||
ok |
|||
@ -0,0 +1,16 @@ |
|||
--TEST-- |
|||
Bug #38623 (leaks in a tricky code with switch() and exceptions) |
|||
--FILE-- |
|||
<?php |
|||
try { |
|||
switch(strtolower("apache")) { |
|||
case "apache": |
|||
throw new Exception("test"); |
|||
break; |
|||
} |
|||
} catch (Exception $e) { |
|||
echo "ok\n"; |
|||
} |
|||
?> |
|||
--EXPECT-- |
|||
ok |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue