summaryrefslogtreecommitdiff
path: root/ext/spl
diff options
context:
space:
mode:
authorEtienne Kneuss <colder@php.net>2010-05-10 12:38:13 +0000
committerEtienne Kneuss <colder@php.net>2010-05-10 12:38:13 +0000
commit815db040a9ec10a25fdce50af038b1f4c3df598c (patch)
tree57a46c226ab3537a43bbcf732bfb0d83184b7a18 /ext/spl
parent8d467078892802e504aafb3f65c9c0edab54b5e4 (diff)
downloadphp-git-815db040a9ec10a25fdce50af038b1f4c3df598c.tar.gz
Fix crash
Diffstat (limited to 'ext/spl')
-rwxr-xr-xext/spl/spl_observer.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index 757be4704a..c325493529 100755
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -250,9 +250,10 @@ void spl_object_storage_addall(spl_SplObjectStorage *intern, zval *this, spl_Spl
static zend_object_value spl_object_storage_new_ex(zend_class_entry *class_type, spl_SplObjectStorage **obj, zval *orig TSRMLS_DC) /* {{{ */
{
- zend_object_value retval;
+ zend_object_value retval;
spl_SplObjectStorage *intern;
- zval *tmp;
+ zend_class_entry *parent = class_type;
+ zval *tmp;
intern = emalloc(sizeof(spl_SplObjectStorage));
memset(intern, 0, sizeof(spl_SplObjectStorage));
@@ -271,11 +272,15 @@ static zend_object_value spl_object_storage_new_ex(zend_class_entry *class_type,
spl_object_storage_addall(intern, orig, other TSRMLS_CC);
}
-
- if (class_type != spl_ce_SplObjectStorage) {
- zend_hash_find(&class_type->function_table, "gethash", sizeof("gethash"), (void **) &intern->fptr_get_hash);
- if (intern->fptr_get_hash && intern->fptr_get_hash->common.scope == spl_ce_SplObjectStorage) {
- intern->fptr_get_hash = NULL;
+ while (parent) {
+ if (parent == spl_ce_SplObjectStorage) {
+ if (class_type != spl_ce_SplObjectStorage) {
+ zend_hash_find(&class_type->function_table, "gethash", sizeof("gethash"), (void **) &intern->fptr_get_hash);
+ if (intern->fptr_get_hash->common.scope == spl_ce_SplObjectStorage) {
+ intern->fptr_get_hash = NULL;
+ }
+ }
+ break;
}
}