From: Nikita Popov Date: Thu, 18 Feb 2021 15:44:10 +0000 (+0100) Subject: Fix crash during default value evaluation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a843c8a4b6c3c066185ae6ed9535fd342643c14c;p=php Fix crash during default value evaluation --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index df88d34a6f..15bc64783d 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1512,6 +1512,11 @@ static bool zend_try_ct_eval_const(zval *zv, zend_string *name, bool is_fully_qu static inline bool zend_is_scope_known() /* {{{ */ { + if (!CG(active_op_array)) { + /* This can only happen when evaluating a default value string. */ + return 0; + } + if (CG(active_op_array)->fn_flags & ZEND_ACC_CLOSURE) { /* Closures can be rebound to a different scope */ return 0;