diff options
| author | Antony Dovgal <tony2001@php.net> | 2007-07-20 10:53:56 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2007-07-20 10:53:56 +0000 |
| commit | bfed3520c922ae6af1b495f34dac4f7fb7f12ab5 (patch) | |
| tree | 2638f212425e04ba0a814f08bc4971f90300315e /ext/spl/spl_array.c | |
| parent | 93af1c1f84aca471a2e6d48a0705b5db66d5a819 (diff) | |
| download | php-git-bfed3520c922ae6af1b495f34dac4f7fb7f12ab5.tar.gz | |
MFH: fix #41691 (ArrayObject::exchangeArray hangs Apache)
Diffstat (limited to 'ext/spl/spl_array.c')
| -rwxr-xr-x | ext/spl/spl_array.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 6f6294526c..e7520915de 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -72,7 +72,7 @@ typedef struct _spl_array_object { static inline HashTable *spl_array_get_hash_table(spl_array_object* intern, int check_std_props TSRMLS_DC) { if ((intern->ar_flags & SPL_ARRAY_IS_SELF) != 0) { return intern->std.properties; - } else if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0)) { + } else if ((intern->ar_flags & SPL_ARRAY_USE_OTHER) && (check_std_props == 0 || (intern->ar_flags & SPL_ARRAY_STD_PROP_LIST) == 0) && Z_TYPE_P(intern->array) == IS_OBJECT) { spl_array_object *other = (spl_array_object*)zend_object_store_get_object(intern->array TSRMLS_CC); return spl_array_get_hash_table(other, check_std_props TSRMLS_CC); } else if ((intern->ar_flags & ((check_std_props ? SPL_ARRAY_STD_PROP_LIST : 0) | SPL_ARRAY_IS_SELF)) != 0) { @@ -1056,6 +1056,7 @@ SPL_METHOD(Array, exchangeArray) } zval_ptr_dtor(&intern->array); intern->array = *array; + intern->ar_flags &= ~SPL_ARRAY_USE_OTHER; } if (object == *array) { intern->ar_flags |= SPL_ARRAY_IS_SELF; |
