mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Fixed memory leak
This commit is contained in:
commit
2d3415a74a
2 changed files with 22 additions and 0 deletions
|
@ -2373,6 +2373,9 @@ static void ZEND_FASTCALL zend_jit_invalid_property_incdec(zval *container, cons
|
|||
zend_throw_error(NULL,
|
||||
"Attempt to increment/decrement property \"%s\" on %s",
|
||||
property_name, zend_zval_type_name(container));
|
||||
if (opline->op1_type == IS_VAR) {
|
||||
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
|
||||
}
|
||||
}
|
||||
|
||||
static void ZEND_FASTCALL zend_jit_invalid_property_assign(zval *container, const char *property_name)
|
||||
|
|
19
ext/opcache/tests/jit/inc_obj_005.phpt
Normal file
19
ext/opcache/tests/jit/inc_obj_005.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--TEST--
|
||||
PRE_INC_OBJ: 005
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
json_encode($y)->y++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $y in %sinc_obj_005.php on line 2
|
||||
|
||||
Fatal error: Uncaught Error: Attempt to increment/decrement property "y" on string in %sinc_obj_005.php:2
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sinc_obj_005.php on line 2
|
Loading…
Add table
Add a link
Reference in a new issue