1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 09:03:04 +02:00

Merge branch 'PHP-5.5'

This commit is contained in:
Xinchen Hui
2013-04-04 14:49:58 +08:00
2 changed files with 17 additions and 3 deletions

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

@@ -0,0 +1,13 @@
--TEST--
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
--FILE--
<?php
set_error_handler(function() { debug_backtrace(); });
function x($s) { $s['a'] = 1; };
$y = '1';
x($y);
print_r($y);
--EXPECTF--
1

View File

@@ -1144,6 +1144,10 @@ convert_to_array:
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
}
if (type != BP_VAR_UNSET) {
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
if (Z_TYPE_P(dim) != IS_LONG) {
switch(Z_TYPE_P(dim)) {
@@ -1172,9 +1176,6 @@ convert_to_array:
convert_to_long(&tmp);
dim = &tmp;
}
if (type != BP_VAR_UNSET) {
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
container = *container_ptr;
result->str_offset.str = container;
PZVAL_LOCK(container);