summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-10 15:58:04 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-10 15:58:42 +0200
commit5fc70243d77d785f08eda4588f2b2a539fa37d18 (patch)
treeedb42c09f871e99632cbc97be7dd6df10804044f /Zend/zend_compile.c
parent3f286fa89aaf4c74c953e2f7474816ce955040cd (diff)
downloadphp-git-5fc70243d77d785f08eda4588f2b2a539fa37d18.tar.gz
Add missing addref for MATCH_ERROR operand
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c5
1 files changed, 4 insertions, 1 deletions
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) {