mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
JIT: Fixed memory leak in BOOL_NOT when opearnd ia a reference to bool
This commit is contained in:
parent
83f283f5ea
commit
5e3eaf14fe
2 changed files with 22 additions and 1 deletions
|
@ -8309,7 +8309,7 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (op1_info & MAY_BE_REF) {
|
||||
if (opline->op1_type == IS_CV && (op1_info & MAY_BE_REF)) {
|
||||
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
|
||||
| ZVAL_DEREF FCARG1a, op1_info
|
||||
op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1a, 0);
|
||||
|
|
21
ext/opcache/tests/jit/bool_not_001.phpt
Normal file
21
ext/opcache/tests/jit/bool_not_001.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--TEST--
|
||||
JIT BOOL_NOT: 001 Memory leak in case of reference to bool
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
opcache.jit=function
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$a = true;
|
||||
var_dump(!$b =& $a);
|
||||
}
|
||||
test();
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
Loading…
Add table
Add a link
Reference in a new issue