Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.c

From: Date: Mon, 16 Jun 2003 15:52:14 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_builtin_functions.c
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1383@lists.php.net to get a copy of this message
MFH? Moriyoshi "Stanislav Malyshev" <stas@php.net> wrote: > stas Mon Jun 16 05:59:03 2003 EDT > > Modified files: > /ZendEngine2 zend_builtin_functions.c > Log: > fix lambda function static vars (related to #17115) > > > Index: ZendEngine2/zend_builtin_functions.c > diff -u ZendEngine2/zend_builtin_functions.c:1.194 ZendEngine2/zend_builtin_functions.c:1.195 > --- ZendEngine2/zend_builtin_functions.c:1.194 Tue Jun 10 16:03:24 2003 > +++ ZendEngine2/zend_builtin_functions.c Mon Jun 16 05:59:02 2003 > @@ -17,7 +17,7 @@ > +----------------------------------------------------------------------+ > */ > > -/* $Id: zend_builtin_functions.c,v 1.194 2003/06/10 20:03:24 imajes Exp $ */ > +/* $Id: zend_builtin_functions.c,v 1.195 2003/06/16 09:59:02 stas Exp $ */ > > #include "zend.h" > #include "zend_API.h" > @@ -1174,20 +1174,21 @@ > efree(eval_name); > > if (retval==SUCCESS) { > - zend_function *func; > + zend_function new_function, *func; > > 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 { > > > > -- > Zend Engine CVS Mailing List (http://cvs.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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