From e21c46aec20b0775fdd6c85faf70f36a618b1c2b Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Tue, 27 Oct 2009 13:02:36 +0000 Subject: [PATCH] - Fixed bug #49142 (crash when exception thrown from __tostring()) --- Zend/zend.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index a2e5114f80..7fa245f109 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1661,9 +1661,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ if (!EG(active_symbol_table)) { zend_rebuild_symbol_table(TSRMLS_C); } - Z_ARRVAL_P(z_context) = EG(active_symbol_table); - Z_TYPE_P(z_context) = IS_ARRAY; - zval_copy_ctor(z_context); + /* during shutdown the symbol table table can be still null */ + if (!EG(active_symbol_table)) { + Z_TYPE_P(z_context) = IS_NULL; + } else { + Z_ARRVAL_P(z_context) = EG(active_symbol_table); + Z_TYPE_P(z_context) = IS_ARRAY; + zval_copy_ctor(z_context); + } params = (zval ***) emalloc(sizeof(zval **)*5); params[0] = &z_error_type; -- 2.40.0