Skip to content

Commit a8ccbaf

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Fix incorrect flag check
2 parents 72cdb0a + d136799 commit a8ccbaf

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6130,7 +6130,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
61306130
if (tmp_reg == ZREG_R0) {
61316131
| IF_NOT_REFCOUNTED ah, >3
61326132
} else {
6133-
| IF_NOT_FLAGS Rd(tmp_reg), IS_TYPE_REFCOUNTED, >3
6133+
| IF_NOT_FLAGS Rd(tmp_reg), (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT), >3
61346134
}
61356135
| GET_ZVAL_PTR Ra(tmp_reg), var_addr
61366136

@@ -6145,7 +6145,7 @@ static int zend_jit_simple_assign(dasm_State **Dst,
61456145
if (tmp_reg == ZREG_R0) {
61466146
| IF_NOT_REFCOUNTED ah, >2
61476147
} else {
6148-
| IF_NOT_FLAGS Rd(tmp_reg), IS_TYPE_REFCOUNTED, >2
6148+
| IF_NOT_FLAGS Rd(tmp_reg), (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT), >2
61496149
}
61506150
| GET_ZVAL_PTR Ra(tmp_reg), var_addr
61516151
| GC_ADDREF Ra(tmp_reg)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
JIT ASSIGN_DIM: 009
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+
$y[] = $r = &$G;
11+
?>
12+
DONE
13+
--EXPECT--
14+
DONE

0 commit comments

Comments
 (0)