> Can you give me a concrete example of when you think this macro doesn't
> behave properly?  If it's correct, I'll try to fix it.  Note that the last
> time you had problems with this (and other) macros these were actually bugs
> in the session module.

    That was another instance showing the inherent lack of
    abstraction in this particular API.  What should be a black
    box is a test of familiarity with implementation details.

        <?php
        $foo = $bar = $a;
        @session_start();
        $_SESSION['foo'] = $_SESSION['bar'] = $a;

    All four zvals are initialized using an undefined variable.
    During the shutdown phase, this occurs:

        zval **val;

        ht = Z_ARRVAL_P(PS(http_session_vars));

        zend_hash_find(&EG(symbol_table), "foo", &val);
        ZEND_SET_SYMBOL_WITH_LENGTH(ht, "foo", *val,
                    (*val)->refcount + 1 , 1);

        zend_hash_find(&EG(symbol_table), "bar", &val);

        /* crash in FREE_ZVAL */
        ZEND_SET_SYMBOL_WITH_LENGTH(ht, "bar", *val,
                    (*val)->refcount + 1 , 1);

    The contents of val at each stage can be seen here:

    http://news.php.net/article.php?group=php.cvs&article=22706

    - Sascha

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to