Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c
| From: | Zeev Suraski | Date: | Mon, 15 Sep 2003 20:53:28 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c | ||
| References: | 1 2 3 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1839@lists.php.net to get a copy of this message | ||
At 23:39 15/09/2003, Marcus Börger wrote:
Hello Zeev, Monday, September 15, 2003, 10:30:45 PM, you wrote: Marcus, That looks wrong. Calling zend_error() does (should) not require duplicating strings. Please revert, I'll look into why there's corruption... Exactly my thoughts until i found out the what is really happening:But it's still bogus and it's completely unacceptable to require duplication of arguments... So it's definitely not a valid fix. We may have to protect the garbage somehow during the error callbacks, but duplicating the arguments to zend_error() - no way! There has to be a better solution.
The variable returned from the function call gets into the GC list and hence any further function call will free it. Since there is no way of keeping the variable i simply duplicated the value for that case. For integer index values we do that already - only an integer must not be copied - a sting pointer kept in a new value must however copy its value to be a duplicate.We do that for simplicity reasons for clearer code, definitely not because of some odd behavior of zend_error() when using custom error handlers... Zeev