Skip to content

Commit 26bc7b3

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fixed extension handling
2 parents 41789e1 + b279de4 commit 26bc7b3

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12469,6 +12469,9 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1246912469

1247012470
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE
1247112471
&& prop_info
12472+
&& (opline->opcode != ZEND_FETCH_OBJ_W ||
12473+
!(opline->extended_value & ZEND_FETCH_OBJ_FLAGS) ||
12474+
!ZEND_TYPE_IS_SET(prop_info->type))
1247212475
&& (!(opline->op1_type & (IS_VAR|IS_TMP_VAR)) || on_this || op1_indirect)) {
1247312476
may_throw = 0;
1247412477
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13174,6 +13174,9 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1317413174

1317513175
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE
1317613176
&& prop_info
13177+
&& (opline->opcode != ZEND_FETCH_OBJ_W ||
13178+
!(opline->extended_value & ZEND_FETCH_OBJ_FLAGS) ||
13179+
!ZEND_TYPE_IS_SET(prop_info->type))
1317713180
&& (!(opline->op1_type & (IS_VAR|IS_TMP_VAR)) || on_this || op1_indirect)) {
1317813181
may_throw = 0;
1317913182
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
JIT: FETCH_OBJ 006
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
class Test {
11+
readonly array $prop;
12+
}
13+
14+
$test = new Test;
15+
16+
try {
17+
throw new Exception;
18+
} catch (Exception) {}
19+
20+
$appendProp2 = (function() {
21+
$this->prop[] = 1;
22+
})->bindTo($test, Test::class);
23+
$appendProp2();
24+
$appendProp2();
25+
?>
26+
--EXPECTF--
27+
Fatal error: Uncaught Error: Cannot modify readonly property Test::$prop in %sfetch_obj_006.php:13
28+
Stack trace:
29+
#0 %sfetch_obj_006.php(16): Test->{closure}()
30+
#1 {main}
31+
thrown in %sfetch_obj_006.php on line 13

0 commit comments

Comments
 (0)