]> granicus.if.org Git - php/commitdiff
- Make zend_internal_function allocate a full zend_function structure so
authorAndi Gutmans <andi@php.net>
Mon, 27 Dec 1999 17:29:35 +0000 (17:29 +0000)
committerAndi Gutmans <andi@php.net>
Mon, 27 Dec 1999 17:29:35 +0000 (17:29 +0000)
  that we don't get memory overruns and Thies doesn't get angry :)

Zend/zend_API.c

index 0cd1433ce1191b3a662b649683263b14dedc69ef..9f8d4bba81dae269e184c4db3d81409289a018a2 100644 (file)
@@ -676,7 +676,8 @@ ZEND_API int _register_list_destructors(void (*list_destructor)(void *), void (*
 int zend_register_functions(zend_function_entry *functions, HashTable *function_table)
 {
        zend_function_entry *ptr = functions;
-       zend_internal_function internal_function;
+       zend_function function;
+       zend_internal_function *internal_function = &function;
        int count=0,unload=0;
        HashTable *target_function_table = function_table;
        CLS_FETCH();
@@ -684,18 +685,18 @@ int zend_register_functions(zend_function_entry *functions, HashTable *function_
        if (!target_function_table) {
                target_function_table = CG(function_table);
        }
-       internal_function.type = ZEND_INTERNAL_FUNCTION;
+       internal_function->type = ZEND_INTERNAL_FUNCTION;
        
        while (ptr->fname) {
-               internal_function.handler = ptr->handler;
-               internal_function.arg_types = ptr->func_arg_types;
-               internal_function.function_name = ptr->fname;
-               if (!internal_function.handler) {
+               internal_function->handler = ptr->handler;
+               internal_function->arg_types = ptr->func_arg_types;
+               internal_function->function_name = ptr->fname;
+               if (!internal_function->handler) {
                        zend_error(E_CORE_WARNING,"Null function defined as active function");
                        zend_unregister_functions(functions, count, target_function_table);
                        return FAILURE;
                }
-               if (zend_hash_add(target_function_table, ptr->fname, strlen(ptr->fname)+1, &internal_function, sizeof(zend_internal_function), NULL) == FAILURE) {
+               if (zend_hash_add(target_function_table, ptr->fname, strlen(ptr->fname)+1, &function, sizeof(zend_function), NULL) == FAILURE) {
                        unload=1;
                        break;
                }