]> granicus.if.org Git - php/commitdiff
Fix a problem in implicit public properties and inheritance
authorZeev Suraski <zeev@php.net>
Fri, 29 Aug 2003 08:51:43 +0000 (08:51 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 29 Aug 2003 08:51:43 +0000 (08:51 +0000)
Zend/zend_compile.c

index 7c1f005bb09c889c169c91fd6abf1063a2965146..3f1f0917d768a233422311cb2c9c15cce3296c7d 100644 (file)
@@ -1756,9 +1756,10 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
                        /* Explicitly copy the value from the parent */
                        zval **pvalue;
 
-                       if (zend_hash_quick_find(&parent_ce->default_properties, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &pvalue)==SUCCESS) {
-                               zend_hash_quick_update(&ce->default_properties, hash_key->arKey, hash_key->nKeyLength, hash_key->h, pvalue, sizeof(zval *), NULL);
+                       if (zend_hash_quick_find(&parent_ce->default_properties, parent_info->name, parent_info->name_length+1, parent_info->h, (void **) &pvalue)==SUCCESS) {
+                               zend_hash_quick_update(&ce->default_properties, parent_info->name, parent_info->name_length+1, parent_info->h, pvalue, sizeof(zval *), NULL);
                                (*pvalue)->refcount++;
+                               zend_hash_del(&ce->default_properties, child_info->name, child_info->name_length+1);
                        }
                        return 1; /* Inherit from the parent */
                }