com php-src: Fixed incorrect address usage: ext/opcache/jit/zen d_jit_x86.dasc ext/opcache/tests/jit/inc_01 9.phpt ext/opcache/tests/jit/inc_020.phpt
| From: | Dmitry Stogov | Date: | Wed, 03 Apr 2019 10:05:09 +0000 |
| Subject: | com php-src: Fixed incorrect address usage: ext/opcache/jit/zen d_jit_x86.dasc ext/opcache/tests/jit/inc_01 9.phpt ext/opcache/tests/jit/inc_020.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105510@lists.php.net to get a copy of this message | ||
Commit: 3df8e27731dce8ed141a91f02832798e67c2b4ea
Author: Dmitry Stogov <dmitry@zend.com> Wed, 3 Apr 2019 13:05:09 +0300
Parents: c91df3aedd7e4b5cd42a2f70b9b3eb5855a48dd4
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3df8e27731dce8ed141a91f02832798e67c2b4ea
Log:
Fixed incorrect address usage
Changed paths:
M ext/opcache/jit/zend_jit_x86.dasc
M ext/opcache/tests/jit/inc_019.phpt
A ext/opcache/tests/jit/inc_020.phpt
Diff:
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 2787d9e..103fc39 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -3026,21 +3026,21 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline,
zend_op_arr
if (opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_POST_INC) {
|.if X64
| mov64 rax, 0x43e0000000000000
- | SET_ZVAL_LVAL op1_addr, rax
+ | SET_ZVAL_LVAL op1_def_addr, rax
|.else
- | SET_ZVAL_LVAL op1_addr, 0
- | SET_ZVAL_W2 op1_addr, 0x41e00000
+ | SET_ZVAL_LVAL op1_def_addr, 0
+ | SET_ZVAL_W2 op1_def_addr, 0x41e00000
|.endif
} else {
|.if X64
| mov64 rax, 0xc3e0000000000000
- | SET_ZVAL_LVAL op1_addr, rax
+ | SET_ZVAL_LVAL op1_def_addr, rax
|.else
- | SET_ZVAL_LVAL op1_addr, 0x00200000
- | SET_ZVAL_W2 op1_addr, 0xc1e00000
+ | SET_ZVAL_LVAL op1_def_addr, 0x00200000
+ | SET_ZVAL_W2 op1_def_addr, 0xc1e00000
|.endif
}
- | SET_ZVAL_TYPE_INFO op1_addr, IS_DOUBLE
+ | SET_ZVAL_TYPE_INFO op1_def_addr, IS_DOUBLE
if ((opline->opcode == ZEND_PRE_INC || opline->opcode == ZEND_PRE_DEC) &&
opline->result_type != IS_UNUSED) {
| ZVAL_COPY_VALUE res_addr, res_use_info, op1_def_addr, MAY_BE_DOUBLE, ZREG_R0, ZREG_R1
diff --git a/ext/opcache/tests/jit/inc_019.phpt b/ext/opcache/tests/jit/inc_019.phpt
index 806e86a..f5e80cf 100644
--- a/ext/opcache/tests/jit/inc_019.phpt
+++ b/ext/opcache/tests/jit/inc_019.phpt
@@ -1,5 +1,5 @@
--TEST--
-JIT INC: 018
+JIT INC: 019
--INI--
opcache.enable=1
opcache.enable_cli=1
diff --git a/ext/opcache/tests/jit/inc_020.phpt b/ext/opcache/tests/jit/inc_020.phpt
new file mode 100644
index 0000000..2ebfe8c
--- /dev/null
+++ b/ext/opcache/tests/jit/inc_020.phpt
@@ -0,0 +1,28 @@
+--TEST--
+JIT INC: 020
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.file_update_protection=0
+opcache.jit_buffer_size=1M
+opcache.protect_memory=1
+;opcache.jit_debug=257
+--SKIPIF--
+<?php require_once('../skipif.inc'); ?>
+--FILE--
+<?php
+function foo($row) {
+ foreach ($row as $key => $value) {
+ if (is_int($key)) {
+ $key++;
+ }
+ if (isset($row[$key])) {
+ return false;
+ }
+ }
+ return true;
+}
+?>
+OK
+--EXPECT--
+OK
\ No newline at end of file