Skip to content

Commit 6c47455

Browse files
committed
Fix assert() in EXT mode
1 parent 8e5b139 commit 6c47455

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Zend/zend_opcode.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,12 +678,18 @@ ZEND_API int pass_two(zend_op_array *op_array)
678678
ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op2);
679679
break;
680680
case ZEND_ASSERT_CHECK:
681+
{
681682
/* If result of assert is unused, result of check is unused as well */
682-
if (op_array->opcodes[opline->op2.opline_num - 1].result_type == IS_UNUSED) {
683+
zend_op *call = &op_array->opcodes[opline->op2.opline_num - 1];
684+
if (call->opcode == ZEND_EXT_FCALL_END) {
685+
call--;
686+
}
687+
if (call->result_type == IS_UNUSED) {
683688
opline->result_type = IS_UNUSED;
684689
}
685690
ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, opline->op2);
686691
break;
692+
}
687693
case ZEND_DECLARE_ANON_CLASS:
688694
case ZEND_DECLARE_ANON_INHERITED_CLASS:
689695
case ZEND_CATCH:

0 commit comments

Comments
 (0)