Merge branch 'PHP-7.0' into PHP-7.1

* PHP-7.0:
  Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
  Compiler warning
This commit is contained in:
Xinchen Hui 2017-09-24 17:24:23 +08:00
commit e8c200515a
3 changed files with 17 additions and 2 deletions

13
Zend/tests/bug75241.phpt Normal file
View File

@ -0,0 +1,13 @@
--TEST--
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
--FILE--
<?php
function eh(){}
set_error_handler('eh');
$d->d = &$d + $d->d/=0;
var_dump($d);
?>
--EXPECT--
float(INF)

View File

@ -222,8 +222,10 @@ ZEND_API void ZEND_FASTCALL convert_scalar_to_number(zval *op) /* {{{ */
if (Z_TYPE(holder) == IS_LONG) { \ if (Z_TYPE(holder) == IS_LONG) { \
if (op == result) { \ if (op == result) { \
zval_ptr_dtor(op); \ zval_ptr_dtor(op); \
ZVAL_LONG(op, Z_LVAL(holder)); \
} else { \
(op) = &(holder); \
} \ } \
(op) = &(holder); \
} \ } \
break; \ break; \
} \ } \

View File

@ -733,7 +733,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
return; return;
} }
intern->flags = value & SPL_DLLIST_IT_MASK | intern->flags & SPL_DLLIST_IT_FIX; intern->flags = (value & SPL_DLLIST_IT_MASK) | (intern->flags & SPL_DLLIST_IT_FIX);
RETURN_LONG(intern->flags); RETURN_LONG(intern->flags);
} }