cvs: Zend(PHP_4_3) / zend_builtin_functions.c

From: Date: Mon, 16 Jun 2003 15:55:07 +0000
Subject: cvs: Zend(PHP_4_3) / zend_builtin_functions.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1385@lists.php.net to get a copy of this message
stas Mon Jun 16 11:55:07 2003 EDT Modified files: (Branch: PHP_4_3) /Zend zend_builtin_functions.c Log: MFZE2: fix lambda function static vars (related to #17115) Index: Zend/zend_builtin_functions.c diff -u Zend/zend_builtin_functions.c:1.124.2.8 Zend/zend_builtin_functions.c:1.124.2.9 --- Zend/zend_builtin_functions.c:1.124.2.8 Mon Jun 9 04:07:55 2003 +++ Zend/zend_builtin_functions.c Mon Jun 16 11:55:07 2003 @@ -1047,20 +1047,21 @@ efree(eval_name); if (retval==SUCCESS) { - zend_function *func; + zend_function *func, new_function; if (zend_hash_find(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME), (void **) &func)==FAILURE) { zend_error(E_ERROR, "Unexpected inconsistency in create_function()"); RETURN_FALSE; } - function_add_ref(func); + new_function = *func; + function_add_ref(&new_function); function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_LONG); do { sprintf(function_name, "%clambda_%d", 0, ++EG(lambda_count)); function_name_length = strlen(function_name+1)+1; - } while (zend_hash_add(EG(function_table), function_name, function_name_length+1, func, sizeof(zend_function), NULL)==FAILURE); + } while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE); zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)); RETURN_STRINGL(function_name, function_name_length, 0); } else {

« previous php.zend-engine.cvs (#1385) next »