cvs: Zend(PHP_4_2_0) / zend_variables.c

From: Date: Sat, 17 Aug 2002 21:39:53 +0000
Subject: cvs: Zend(PHP_4_2_0) / zend_variables.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-330@lists.php.net to get a copy of this message
zeev Sat Aug 17 17:39:53 2002 EDT Modified files: (Branch: PHP_4_2_0) /Zend zend_variables.c Log: Look for $GLOBALS when playing with the type of $GLOBALS Index: Zend/zend_variables.c diff -u Zend/zend_variables.c:1.41 Zend/zend_variables.c:1.41.2.1 --- Zend/zend_variables.c:1.41 Sun Jan 6 10:21:09 2002 +++ Zend/zend_variables.c Sat Aug 17 17:39:53 2002 @@ -53,9 +53,14 @@ } } break; - case IS_OBJECT: - zend_hash_destroy(zvalue->value.obj.properties); - FREE_HASHTABLE(zvalue->value.obj.properties); + case IS_OBJECT: { + TSRMLS_FETCH(); + + if (zvalue->value.obj.properties != &EG(symbol_table)) { + zend_hash_destroy(zvalue->value.obj.properties); + FREE_HASHTABLE(zvalue->value.obj.properties); + } + } break; case IS_RESOURCE: { TSRMLS_FETCH(); @@ -122,7 +127,11 @@ case IS_OBJECT: { zval *tmp; HashTable *original_ht = zvalue->value.obj.properties; + TSRMLS_FETCH(); + if (zvalue->value.obj.properties == &EG(symbol_table)) { + return SUCCESS; /* do nothing */ + } ALLOC_HASHTABLE_REL(zvalue->value.obj.properties); zend_hash_init(zvalue->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0); zend_hash_copy(zvalue->value.obj.properties, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));

« previous php.zend-engine.cvs (#330) next »