mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
@@ -5413,7 +5413,7 @@ static int zend_jit_long_math_helper(zend_jit_ctx *jit,
|
||||
jit_SET_EX_OPLINE(jit, opline);
|
||||
ir_GUARD(IR_FALSE, jit_STUB_ADDR(jit, jit_stub_negative_shift));
|
||||
if (Z_MODE(res_addr) == IS_REG) {
|
||||
zend_jit_def_reg(jit, res_addr, ir_CONST_LONG(0)); // dead code
|
||||
ref = ir_CONST_LONG(0); // dead code
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -5462,7 +5462,7 @@ static int zend_jit_long_math_helper(zend_jit_ctx *jit,
|
||||
jit_SET_EX_OPLINE(jit, opline);
|
||||
ir_GUARD(IR_FALSE, jit_STUB_ADDR(jit, jit_stub_negative_shift));
|
||||
if (Z_MODE(res_addr) == IS_REG) {
|
||||
zend_jit_def_reg(jit, res_addr, ir_CONST_LONG(0)); // dead code
|
||||
ref = ir_CONST_LONG(0); // dead code
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -5503,7 +5503,7 @@ static int zend_jit_long_math_helper(zend_jit_ctx *jit,
|
||||
jit_SET_EX_OPLINE(jit, opline);
|
||||
ir_GUARD(IR_FALSE, jit_STUB_ADDR(jit, jit_stub_mod_by_zero));
|
||||
if (Z_MODE(res_addr) == IS_REG) {
|
||||
zend_jit_def_reg(jit, res_addr, ir_CONST_LONG(0)); // dead code
|
||||
ref = ir_CONST_LONG(0); // dead code
|
||||
}
|
||||
} else if (zend_long_is_power_of_two(op2_lval) && op1_range && op1_range->min >= 0) {
|
||||
ref = ir_AND_L(jit_Z_LVAL(jit, op1_addr), ir_CONST_LONG(op2_lval - 1));
|
||||
|
||||
21
ext/opcache/tests/jit/mod_008.phpt
Normal file
21
ext/opcache/tests/jit/mod_008.phpt
Normal file
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
JIT MOD: 008
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
function foo() {
|
||||
foo(1 / 0 % 0);
|
||||
};
|
||||
@foo();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught DivisionByZeroError: Division by zero in %smod_008.php:3
|
||||
Stack trace:
|
||||
#0 %smod_008.php(5): foo()
|
||||
#1 {main}
|
||||
thrown in %smod_008.php on line 3
|
||||
Reference in New Issue
Block a user