diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-07-10 15:58:04 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-07-10 15:58:42 +0200 |
| commit | 5fc70243d77d785f08eda4588f2b2a539fa37d18 (patch) | |
| tree | edb42c09f871e99632cbc97be7dd6df10804044f /Zend/zend_compile.c | |
| parent | 3f286fa89aaf4c74c953e2f7474816ce955040cd (diff) | |
| download | php-git-5fc70243d77d785f08eda4588f2b2a539fa37d18.tar.gz | |
Add missing addref for MATCH_ERROR operand
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 5 |
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) { |
