php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63682
Patch bug63682.patch revision 2012-12-04 06:09 UTC by laruence@php.net
revision 2012-12-04 05:41 UTC by laruence@php.net

Patch bug63682.patch for SimpleXML related Bug #63682

Patch version 2012-12-04 05:41 UTC

Return to Bug #63682 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: laruence@php.net

diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 5514f0f..6579655 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1081,15 +1081,9 @@ static HashTable * sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{
 		zend_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0);
 	}
 	else if (sxe->properties) {
-		if (GC_G(gc_active)) {
-			return sxe->properties;
-		}
 		zend_hash_clean(sxe->properties);
 		rv = sxe->properties;
 	} else {
-		if (GC_G(gc_active)) {
-			return NULL;
-		}
 		ALLOC_HASHTABLE(rv);
 		zend_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0);
 		sxe->properties = rv;
@@ -1201,6 +1195,20 @@ next_iter:
 }
 /* }}} */
 
+static HashTable * sxe_get_gc(zval *object, zval ***table, int *n TSRMLS_DC) /* {{{ */ {
+	php_sxe_object  *sxe;
+	sxe = php_sxe_fetch_object(object TSRMLS_CC);
+	
+	*table = NULL;
+	*n = 0;
+	if (sxe->properties) {
+		return sxe->properties;
+	} else {
+		return NULL;
+	}
+}
+/* }}} */
+
 static HashTable * sxe_get_properties(zval *object TSRMLS_DC) /* {{{ */
 {
 	return sxe_get_prop_hash(object, 0 TSRMLS_CC);
@@ -1966,7 +1974,9 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */
 	sxe_objects_compare,
 	sxe_object_cast,
 	sxe_count_elements,
-	sxe_get_debug_info
+	sxe_get_debug_info,
+	NULL,
+	sxe_get_gc
 };
 /* }}} */
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 03:01:31 2024 UTC