mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Fixed bug #70293 (Crash with specific assertions and zend.assertions=-1)
This commit is contained in:
parent
9a138b47c9
commit
34834c58fa
2
NEWS
2
NEWS
@ -17,7 +17,7 @@ PHP NEWS
|
||||
. Fixed bug #69487 (SAPI may truncate POST data). (cmb)
|
||||
. Fixed bug #70198 (Checking liveness does not work as expected).
|
||||
(Shafreeck Sea, Anatol Belski)
|
||||
. Fixed bug #70241 (Skipped assertions affect Generator returns). (Bob)
|
||||
. Fixed bug #70241/#70293 (Skipped assertions affect Generator returns). (Bob)
|
||||
. Fixed bug #70239 (Creating a huge array doesn't result in exhausted,
|
||||
but segfault). (Laruence, Anatol)
|
||||
. Fixed bug causing exception traces with anon classes to be truncated. (Bob)
|
||||
|
16
Zend/tests/bug70293.phpt
Normal file
16
Zend/tests/bug70293.phpt
Normal file
@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Crash with specific assertions and zend.assertions=-1
|
||||
--INI--
|
||||
zend.assertions=-1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function f() {
|
||||
assert(@$a ?: 1);
|
||||
echo "OK";
|
||||
};
|
||||
f();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
OK
|
@ -3074,10 +3074,12 @@ static void zend_compile_assert_side_effects(zend_ast *ast) /* {{{ */
|
||||
|
||||
for (i = 0; i < children; i++) {
|
||||
zend_ast *child = (zend_ast_is_list(ast) ? zend_ast_get_list(ast)->child : ast->child)[i];
|
||||
if (child->kind == ZEND_AST_YIELD) {
|
||||
zend_mark_function_as_generator();
|
||||
} else if (ast->kind >= ZEND_AST_IS_LIST_SHIFT) {
|
||||
zend_compile_assert_side_effects(child);
|
||||
if (child) {
|
||||
if (child->kind == ZEND_AST_YIELD) {
|
||||
zend_mark_function_as_generator();
|
||||
} else if (ast->kind >= ZEND_AST_IS_LIST_SHIFT) {
|
||||
zend_compile_assert_side_effects(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user