From 5fc70243d77d785f08eda4588f2b2a539fa37d18 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 10 Jul 2020 15:58:04 +0200 Subject: [PATCH] Add missing addref for MATCH_ERROR operand --- Zend/zend_compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index b2a33068f5..1e2dfb5a4d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5368,7 +5368,10 @@ void zend_compile_match(znode *result, zend_ast *ast) opline->extended_value = get_next_op_number(); } - zend_emit_op(NULL, ZEND_MATCH_ERROR, &expr_node, NULL); + zend_op *opline = zend_emit_op(NULL, ZEND_MATCH_ERROR, &expr_node, NULL); + if (opline->op1_type == IS_CONST) { + Z_TRY_ADDREF_P(CT_CONSTANT(opline->op1)); + } } for (uint32_t i = 0; i < arms->children; ++i) { -- 2.50.1