forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix phpGH-15834: Segfault with hook "simple get" cache slot and minim…
…al JIT The FETCH_OBJ_R VM handler has an optimization that directly enters into a hook if it is a simpler getter hook. This is not compatible with the minimal JIT because the minimal JIT will try to continue executing the opcodes after the FETCH_OBJ_R. To solve this, we check whether the opcode is still the expected one after the execution of the VM handler. If it is not, we know that we are going to execute a simple hook. In that case, exit to the VM.
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
GH-15834 (Segfault with hook "simple get" cache slot and minimal JIT) | ||
--EXTENSIONS-- | ||
opcache | ||
--INI-- | ||
opcache.jit=1111 | ||
--FILE-- | ||
<?php | ||
class A { | ||
public $_prop = 1; | ||
public $prop { | ||
get => $this->_prop; | ||
} | ||
} | ||
|
||
$a = new A; | ||
for ($i=0;$i<5;$i++) { | ||
echo $a->prop; | ||
$a->_prop++; | ||
} | ||
?> | ||
--EXPECT-- | ||
12345 |