Skip to content

Commit 8d069d2

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix jump after zend_jit_invalid_property_assign()
2 parents a5e5483 + b0e16f0 commit 8d069d2

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13315,7 +13315,7 @@ static int zend_jit_assign_obj_op(dasm_State **Dst,
1331513315
}
1331613316
if (((opline+1)->op1_type & (IS_VAR|IS_TMP_VAR))
1331713317
&& (val_info & (MAY_BE_REF|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
13318-
| jmp >7
13318+
| jmp >8
1331913319
} else {
1332013320
| jmp ->exception_handler
1332113321
}
@@ -13647,7 +13647,7 @@ static int zend_jit_assign_obj(dasm_State **Dst,
1364713647
}
1364813648
if (((opline+1)->op1_type & (IS_VAR|IS_TMP_VAR))
1364913649
&& (val_info & (MAY_BE_REF|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
13650-
| jmp >8
13650+
| jmp >7
1365113651
} else {
1365213652
| jmp ->exception_handler
1365313653
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
JIT ASSIGN_OBJ: Assign property on null
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--EXTENSIONS--
9+
opcache
10+
--FILE--
11+
<?php
12+
function test1($o) {
13+
$o->x = new stdClass;
14+
}
15+
function test2($o) {
16+
$o->x += new stdClass;
17+
}
18+
19+
try {
20+
test1(null);
21+
} catch (Error $e) {
22+
echo $e->getMessage(), "\n";
23+
}
24+
25+
try {
26+
test2(null);
27+
} catch (Error $e) {
28+
echo $e->getMessage(), "\n";
29+
}
30+
31+
?>
32+
--EXPECT--
33+
Attempt to assign property "x" on null
34+
Attempt to assign property "x" on null

0 commit comments

Comments
 (0)