Bug #80447 (Strange out of memory error when running with JIT)

This commit is contained in:
Dmitry Stogov 2020-12-01 16:43:05 +03:00
parent 8ad2b59e12
commit 1674c96c0b
3 changed files with 36 additions and 1 deletions

1
NEWS
View File

@ -25,6 +25,7 @@ PHP NEWS
. Fixed bug #80377 (Opcache misses executor_globals). (Nikita)
. Fixed bug #80433 (Unable to disable the use of the AVX command when using
JIT). (Nikita)
. Bug #80447 (Strange out of memory error when running with JIT). (Dmitry)
- OpenSSL:
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to

View File

@ -3662,7 +3662,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
zend_jit_label(&dasm_state, 0); /* start of of trace loop */
if (ra && trace_buffer->stop == ZEND_JIT_TRACE_STOP_LOOP) {
if (ra) {
zend_ssa_phi *phi = ssa->blocks[1].phis;
while (phi) {

View File

@ -0,0 +1,34 @@
--TEST--
Bug #80447 (Strange out of memory error when running with JIT)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function createTree($depth) {
if (!$depth) {
return [null, null];
}
$depth--;
return [
createTree($depth),
createTree($depth)
];
}
function checkTree($treeNode) {
return 1
+ ($treeNode[0][0] === null ? 1 : checkTree($treeNode[0]))
+ ($treeNode[1][0] === null ? 1 : checkTree($treeNode[1]));
}
$tree = createTree(12);
var_dump(checkTree($tree));
--EXPECT--
int(8191)