This commit is contained in:
Nikita Popov 2017-06-23 17:32:45 +02:00
parent 4948da178a
commit 5b5a92b8b6
3 changed files with 27 additions and 1 deletions

4
NEWS
View File

@ -7,6 +7,10 @@ PHP NEWS
(jhdxr)
. Fixed bug #74761 (Unary operator expected error on some systems). (petk)
- Opcache:
. Fixed bug #74623 (Infinite loop in type inference when using HTMLPurifier).
(nikic)
- SPL:
. Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr)

View File

@ -3109,7 +3109,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
opline->opcode == ZEND_FETCH_OBJ_RW ||
opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) {
if (opline->opcode != ZEND_FETCH_DIM_FUNC_ARG) {
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_NULL)) {
if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
tmp |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
}

View File

@ -0,0 +1,22 @@
--TEST--
Bug #74623: Infinite loop in type inference when using HTMLPurifier
--FILE--
<?php
function crash($arr) {
$current_item = false;
foreach($arr as $item) {
if($item->name === 'string') {
$current_item = $item;
} else {
$current_item->a[] = '';
}
}
}
?>
===DONE===
--EXPECT--
===DONE===