From: Nikita Popov Date: Fri, 25 Mar 2016 18:27:20 +0000 (+0100) Subject: Fix assert() in EXT mode X-Git-Tag: php-7.1.0alpha1~419 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c47455f73405658ae0ccd4e9d9da812080e8c83;p=php Fix assert() in EXT mode --- diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 4800939b5f..6c1488ad0c 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -678,12 +678,18 @@ ZEND_API int pass_two(zend_op_array *op_array) ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op2); break; case ZEND_ASSERT_CHECK: + { /* If result of assert is unused, result of check is unused as well */ - if (op_array->opcodes[opline->op2.opline_num - 1].result_type == IS_UNUSED) { + zend_op *call = &op_array->opcodes[opline->op2.opline_num - 1]; + if (call->opcode == ZEND_EXT_FCALL_END) { + call--; + } + if (call->result_type == IS_UNUSED) { opline->result_type = IS_UNUSED; } ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op2); break; + } case ZEND_DECLARE_ANON_CLASS: case ZEND_DECLARE_ANON_INHERITED_CLASS: case ZEND_CATCH: