mirror of
https://github.com/php/php-src.git
synced 2026-04-11 18:13:00 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fix register clobbering
This commit is contained in:
@@ -15162,6 +15162,9 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend
|
||||
if (op1_info & MAY_BE_DOUBLE) {
|
||||
regset = ZEND_REGSET(ZREG_FPR0);
|
||||
}
|
||||
if (opline->result_type != IS_UNUSED && (op1_info & MAY_BE_LONG)) {
|
||||
ZEND_REGSET_INCL(regset, ZREG_REG1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_ADD:
|
||||
|
||||
@@ -16074,6 +16074,9 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend
|
||||
if (op1_info & MAY_BE_DOUBLE) {
|
||||
regset = ZEND_REGSET(ZREG_XMM0);
|
||||
}
|
||||
if (opline->result_type != IS_UNUSED && (op1_info & MAY_BE_LONG)) {
|
||||
ZEND_REGSET_INCL(regset, ZREG_R1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_ADD:
|
||||
|
||||
21
ext/opcache/tests/jit/reg_alloc_014.phpt
Normal file
21
ext/opcache/tests/jit/reg_alloc_014.phpt
Normal file
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Register Alloction 014: Register clobbering
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
for($cnt = 0; $cnt < 6; $cnt++) {
|
||||
$e = $a-- + $a-- + $a *= $a;
|
||||
for ($i = 0; $i <= .1; $i++);
|
||||
}
|
||||
}
|
||||
foo();
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $a in %sreg_alloc_014.php on line 4
|
||||
DONE
|
||||
Reference in New Issue
Block a user