diff options
author | David Soria Parra <dsp@php.net> | 2009-10-27 13:02:36 +0000 |
---|---|---|
committer | David Soria Parra <dsp@php.net> | 2009-10-27 13:02:36 +0000 |
commit | e8359d3f904cf7232aa70ddf1e5d20fa936795fd (patch) | |
tree | 8a3dff883ba44b7bf14cd065db1e1b1b5e067320 | |
parent | 89fec084f11c8a2c495711767084db79ce2ffdf8 (diff) | |
download | php-git-e8359d3f904cf7232aa70ddf1e5d20fa936795fd.tar.gz |
- Fixed bug #49142 (crash when exception thrown from __tostring())
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | Zend/zend.c | 12 |
2 files changed, 11 insertions, 3 deletions
@@ -11,6 +11,8 @@ PHP NEWS - Fixed memory leak in extension loading when an error occurs on Windows. (Pierre) +- Fixed bug #49142 (crash when exception thrown from __tostring()). + (David Soria Parra) - Fixed bug #49990 (SNMP3 warning message about security level printed twice). (Jani) - Fixed bug #49985 (pdo_pgsql prepare() re-use previous aborted diff --git a/Zend/zend.c b/Zend/zend.c index a139ad999f..8faf0d37e3 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1067,9 +1067,15 @@ 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; |