Skip to content

Commit

Permalink
Merge branch 'PHP-8.3'
Browse files Browse the repository at this point in the history
* PHP-8.3:
  Fixed phpGH-12509: JIT assertion when running php-parser tests
  • Loading branch information
dstogov committed Oct 26, 2023
2 parents e95faae + e52d617 commit 7a594af
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Zend/Optimizer/zend_inference.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down
28 changes: 28 additions & 0 deletions ext/opcache/tests/jit/gh12509.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
GH-12509: JIT assertion when running php-parser tests
--INI--
opcache.enable=1
opcache.enable_cli=1
--FILE--
<?php
function capture() {
$GLOBALS["x"] = new Exception();
}
function test($a) {
$a[1] = 1;
$a[2] = 2;
capture();
$a[3] = 3;
return $a;
}
var_dump(test([]));
?>
--EXPECT--
array(3) {
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
}

0 comments on commit 7a594af

Please sign in to comment.