On Tue, 22 Jul 2003, Zeev Suraski wrote:
> At 12:22 22/07/2003, Sascha Schumann wrote:
> > If it is not irregular, the engine code should be able to
> > deal with it correctly. Right now, it falls over itself
> > quickly and dies ungracefully.
>
> Then ZEND_SET_SYMBOL_WITH_LENGTH should be fixed. I'm not sure who wrote
> it, but it wasn't Andi nor me. The engine works with it properly, more
> than that, it completely relies on this behavior.
Btw, here is the annotated source code.
1.33 (andi 03-Dec-99): #define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name,
name_length, var, _refcount, _is_ref)
1.18 (zeev 30-Jul-99): {
1.18 (zeev 30-Jul-99): zval **orig_var;
1.18 (zeev 30-Jul-99):
1.19 (zeev 30-Jul-99): if (zend_hash_find(symtable, (name),
(name_length), (void **) &orig_var)==SUCCESS
1.18 (zeev 30-Jul-99): && PZVAL_IS_REF(*orig_var)) {
1.30 (zeev 01-Dec-99): (var)->refcount =
(*orig_var)->refcount;
1.28 (andrei 18-Oct-99): (var)->is_ref = 1;
1.18 (zeev 30-Jul-99):
1.31 (zeev 01-Dec-99): if (_refcount) {
1.31 (zeev 01-Dec-99): (var)->refcount +=
_refcount-1;
1.31 (zeev 01-Dec-99): }
1.18 (zeev 30-Jul-99): zval_dtor(*orig_var);
1.30 (zeev 01-Dec-99): **orig_var = *(var);
1.44 (andi 24-Dec-99): FREE_ZVAL(var);
1.18 (zeev 30-Jul-99): } else {
1.32 (andi 02-Dec-99): (var)->is_ref = _is_ref;
1.30 (zeev 01-Dec-99): if (_refcount) {
1.30 (zeev 01-Dec-99): (var)->refcount =
_refcount;
1.30 (zeev 01-Dec-99): }
1.30 (zeev 01-Dec-99): zend_hash_update(symtable,
(name), (name_length), &(var), sizeof(zval *), NULL);
1.18 (zeev 30-Jul-99): }
1.18 (zeev 30-Jul-99): }
- Sascha
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php