]> granicus.if.org Git - php/commitdiff
- Use function_add_ref() here too
authorZeev Suraski <zeev@php.net>
Fri, 24 Dec 1999 14:49:57 +0000 (14:49 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 24 Dec 1999 14:49:57 +0000 (14:49 +0000)
Zend/zend_compile.c

index b2a4cc32c9b05a2b0a35c9f98d44e5699201ed10..19c30394115e37c163478875df6b1bab137d6ee6 100644 (file)
@@ -1035,13 +1035,13 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
                                zend_function *function;
 
                                zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &function);
-                               (*function->op_array.refcount)++;
-                               if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) {
+                               if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), (void **) &function)==FAILURE) {
                                        if (!compile_time) {
                                                zend_error(E_ERROR, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val);
                                        }
                                        return FAILURE;
                                } else {
+                                       function_add_ref(function);
                                        return SUCCESS;
                                }
                        }