cvs: Zend / zend_compile.c
| From: | Andi Gutmans | Date: | Sun, 10 Nov 2002 05:25:27 +0000 |
| Subject: | cvs: Zend / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-594@lists.php.net to get a copy of this message | ||
andi Sun Nov 10 00:25:27 2002 EDT
Modified files:
/Zend zend_compile.c
Log:
- Should fix Bug #17882
Index: Zend/zend_compile.c
diff -u Zend/zend_compile.c:1.239 Zend/zend_compile.c:1.240
--- Zend/zend_compile.c:1.239 Sun Nov 3 10:16:44 2002
+++ Zend/zend_compile.c Sun Nov 10 00:25:27 2002
@@ -748,7 +748,17 @@
op_array.return_reference = return_reference;
if (is_method) {
- zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1, &op_array,
sizeof(zend_op_array), (void **) &CG(active_op_array));
+ if (zend_hash_add(&CG(active_class_entry)->function_table, name, name_len+1,
&op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)) == FAILURE) {
+ zend_op_array *child_op_array, *parent_op_array;
+ if (CG(active_class_entry)->parent
+ && (zend_hash_find(&CG(active_class_entry)->function_table, name, name_len+1,
(void **) &child_op_array) == SUCCESS)
+ && (zend_hash_find(&CG(active_class_entry)->parent->function_table, name,
name_len+1, (void **) &parent_op_array) == SUCCESS)
+ && (child_op_array->refcount == parent_op_array->refcount)) {
+ zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1,
&op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
+ } else {
+ zend_error(E_COMPILE_ERROR, "Cannot redeclare %s()", name);
+ }
+ }
} else {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);