diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index b901055ef7f..10a92981ed7 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -1731,6 +1731,12 @@ static uint32_t get_ssa_alias_types(zend_ssa_alias_kind alias) { } \ if (__var >= 0) { \ zend_ssa_var *__ssa_var = &ssa_vars[__var]; \ + if (__ssa_var->var < op_array->num_args) { \ + if (__type & MAY_BE_RC1) { \ + /* TODO: may be captured by exception backtreace */ \ + __type |= MAY_BE_RCN; \ + } \ + } \ if (__ssa_var->var < op_array->last_var) { \ if (__type & (MAY_BE_REF|MAY_BE_RCN)) { \ __type |= MAY_BE_RC1 | MAY_BE_RCN; \ diff --git a/ext/opcache/tests/jit/gh12509.phpt b/ext/opcache/tests/jit/gh12509.phpt new file mode 100644 index 00000000000..ae8bdee6619 --- /dev/null +++ b/ext/opcache/tests/jit/gh12509.phpt @@ -0,0 +1,28 @@ +--TEST-- +GH-12509: JIT assertion when running php-parser tests +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--FILE-- + +--EXPECT-- +array(3) { + [1]=> + int(1) + [2]=> + int(2) + [3]=> + int(3) +} \ No newline at end of file