]> granicus.if.org Git - php/commitdiff
use correct check for constants and stop segfaulting
authorAntony Dovgal <tony2001@php.net>
Thu, 8 Jan 2009 22:35:30 +0000 (22:35 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 8 Jan 2009 22:35:30 +0000 (22:35 +0000)
Zend/zend_compile.c

index 7ddbf7b037d2069322978e444971933bcc23e737..f12b6ec5234059e7eb23b47140699a6cd556bc20 100644 (file)
@@ -4868,7 +4868,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
        } else if (UG(unicode) && ZEND_U_EQUAL(Z_TYPE(var->u.constant), Z_UNIVAL(var->u.constant), Z_UNILEN(var->u.constant), "encoding", sizeof("encoding")-1)) {
                UErrorCode status = U_ZERO_ERROR;
 
-               if (Z_TYPE(val->u.constant) == IS_CONSTANT) {
+               if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
                        zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding");
                }
                /*