JIT: Fixed memory leak in BOOL_NOT when opearnd ia a reference to bool

This commit is contained in:
Dmitry Stogov 2021-09-16 17:18:51 +03:00
parent 83f283f5ea
commit 5e3eaf14fe
2 changed files with 22 additions and 1 deletions

View file

@ -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);

View 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)