Skip to content

Commit bf21261

Browse files
committed
Add missing undefined variable warning an result initialization.
(This fixes Zend/tests/bug78531.phpt without PROFITABILITY_CHECKS).
1 parent db309b2 commit bf21261

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,17 @@ static void ZEND_FASTCALL zend_jit_invalid_property_write(zval *container, const
20152015

20162016
static void ZEND_FASTCALL zend_jit_invalid_property_incdec(zval *container, const char *property_name)
20172017
{
2018+
zend_execute_data *execute_data = EG(current_execute_data);
2019+
const zend_op *opline = EX(opline);
2020+
2021+
if (Z_TYPE_P(container) == IS_UNDEF && opline->op1_type == IS_CV) {
2022+
zend_string *cv = EX(func)->op_array.vars[EX_VAR_TO_NUM(opline->op1.var)];
2023+
2024+
zend_error(E_WARNING, "Undefined variable $%s", ZSTR_VAL(cv));
2025+
}
2026+
if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
2027+
ZVAL_UNDEF(EX_VAR(opline->result.var));
2028+
}
20182029
zend_throw_error(NULL,
20192030
"Attempt to increment/decrement property \"%s\" on %s",
20202031
property_name, zend_zval_type_name(container));

0 commit comments

Comments
 (0)