summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-06-29 08:38:24 +0000
committerAndi Gutmans <andi@php.net>2002-06-29 08:38:24 +0000
commitdd8df522233d32f7c1a4e3cbc58514e15dcb9fc2 (patch)
treeead779063ebab2a05d0933081927ba51f8404a8a /Zend
parent6339bd59120eaee13e4636f74bbf9a9d54efdce4 (diff)
downloadphp-git-dd8df522233d32f7c1a4e3cbc58514e15dcb9fc2.tar.gz
- Fix for bug #17882. We complain if the same method is declared twice.
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index cebaecf4e7..8f0e1d25b0 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -924,7 +924,9 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
op_array.scope = CG(active_class_entry);
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_error(E_COMPILE_ERROR, "Multiply defined method '%s'", name);
+ }
if ((CG(active_class_entry)->name_length == (uint) name_len) && (!memcmp(CG(active_class_entry)->name, name, name_len))) {
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
} else if ((function_name->u.constant.value.str.len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(function_name->u.constant.value.str.val, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {