mirror of
https://github.com/php/php-src.git
synced 2026-04-03 22:22:18 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix memory leak in SCCP
This commit is contained in:
@@ -1471,6 +1471,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
|
||||
if (opline->opcode == ZEND_PRE_INC_OBJ
|
||||
|| opline->opcode == ZEND_PRE_DEC_OBJ) {
|
||||
SET_RESULT(result, &tmp2);
|
||||
zval_ptr_dtor_nogc(&tmp1);
|
||||
} else {
|
||||
SET_RESULT(result, &tmp1);
|
||||
}
|
||||
|
||||
17
ext/opcache/tests/opt/sccp_035.phpt
Normal file
17
ext/opcache/tests/opt/sccp_035.phpt
Normal file
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
SCCP 035: memory leak
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.optimization_level=-1
|
||||
--FILE--
|
||||
<?php
|
||||
function test() {
|
||||
$obj = new stdClass;
|
||||
$obj->$b = ~$b = $a='';
|
||||
$obj->$a--;
|
||||
}
|
||||
?>
|
||||
DONE
|
||||
--EXPECT--
|
||||
DONE
|
||||
Reference in New Issue
Block a user