mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix memory leak
This commit is contained in:
commit
7ebda198ea
@ -5737,7 +5737,7 @@ static int zend_jit_assign_to_typed_ref(dasm_State **Dst,
|
||||
| // if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
| MEM_LOAD_64_ZTS ldr, REG0, executor_globals, exception, TMP1
|
||||
| cbz REG0, >8 // END OF zend_jit_assign_to_variable()
|
||||
| b ->exception_handler_undef
|
||||
| b ->exception_handler
|
||||
} else {
|
||||
| b >8
|
||||
}
|
||||
|
@ -6256,7 +6256,7 @@ static int zend_jit_assign_to_typed_ref(dasm_State **Dst,
|
||||
| // if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
| MEM_CMP_ZTS aword, executor_globals, exception, 0, r0
|
||||
| je >8 // END OF zend_jit_assign_to_variable()
|
||||
| jmp ->exception_handler_undef
|
||||
| jmp ->exception_handler
|
||||
} else {
|
||||
| jmp >8
|
||||
}
|
||||
|
26
ext/opcache/tests/jit/assign_053.phpt
Normal file
26
ext/opcache/tests/jit/assign_053.phpt
Normal file
@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
JIT ASSIGN: memory leak
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public string $x;
|
||||
}
|
||||
$test=new Test;
|
||||
$test->x = " $y ";
|
||||
$r = &$test->x + ($r = $y);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Undefined variable $y in %sassign_053.php on line 6
|
||||
|
||||
Warning: Undefined variable $y in %sassign_053.php on line 7
|
||||
|
||||
Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %sassign_053.php on line 7
|
Loading…
Reference in New Issue
Block a user