com php-src: Fixed bug #70293 (Crash with specific assertions and zend.assertions=-1): Zend/tests/bug70293 .phpt Zend/zend_compile.c

From: Date: Tue, 18 Aug 2015 19:02:53 +0000
Subject: com php-src: Fixed bug #70293 (Crash with specific assertions and zend.assertions=-1): Zend/tests/bug70293 .phpt Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88654@lists.php.net to get a copy of this message
Commit: ab57205019edcd73d47b474337337e44fdcac25c Author: Bob Weinand <bobwei9@hotmail.com> Tue, 18 Aug 2015 15:01:24 +0200 Committer: Anatol Belski <ab@php.net> Tue, 18 Aug 2015 21:02:53 +0200 Parents: a02b3fd4b0553965a6b463a3dcbf4dbd728a821d Branches: PHP-7.0.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ab57205019edcd73d47b474337337e44fdcac25c Log: Fixed bug #70293 (Crash with specific assertions and zend.assertions=-1) Bugs: https://bugs.php.net/70293 Changed paths: A Zend/tests/bug70293.phpt M Zend/zend_compile.c Diff: diff --git a/Zend/tests/bug70293.phpt b/Zend/tests/bug70293.phpt new file mode 100644 index 0000000..0722fb5 --- /dev/null +++ b/Zend/tests/bug70293.phpt @@ -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 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c73ca98..b795f39 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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); + } } } }

« previous php.cvs (#88654) next »