[PATCH] the most bizarre thing...
| From: | Steph Fox | Date: | Fri, 02 Jun 2006 06:41:14 +0000 |
| Subject: | [PATCH] the most bizarre thing... | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-23865@lists.php.net to get a copy of this message | ||
Dmitry, have you _any_ idea why this might fix my CG table-freeing crash?
It still gets past the != check, so presumably it still does the same destroy-and-free - but it works now?!
- Steph
Index: Zend/zend.c =================================================================== RCS file: /repository/ZendEngine2/zend.c,v retrieving revision 1.308.2.12.2.8 diff -u -r1.308.2.12.2.8 zend.c --- Zend/zend.c 19 May 2006 06:09:14 -0000 1.308.2.12.2.8 +++ Zend/zend.c 2 Jun 2006 06:26:41 -0000 @@ -462,15 +462,15 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS_DC) { - if (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE) { + if (GLOBAL_FUNCTION_TABLE && (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE)) { zend_hash_destroy(compiler_globals->function_table); free(compiler_globals->function_table); } - if (compiler_globals->class_table != GLOBAL_CLASS_TABLE) { + if (GLOBAL_CLASS_TABLE && (compiler_globals->class_table != GLOBAL_CLASS_TABLE)) { zend_hash_destroy(compiler_globals->class_table); free(compiler_globals->class_table); } - if (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE) { + if (GLOBAL_AUTO_GLOBALS_TABLE && (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE)) { zend_hash_destroy(compiler_globals->auto_globals); free(compiler_globals->auto_globals); }
Index: Zend/zend.c =================================================================== RCS file: /repository/ZendEngine2/zend.c,v retrieving revision 1.308.2.12.2.8 diff -u -r1.308.2.12.2.8 zend.c --- Zend/zend.c 19 May 2006 06:09:14 -0000 1.308.2.12.2.8 +++ Zend/zend.c 2 Jun 2006 06:26:41 -0000 @@ -462,15 +462,15 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS_DC) { - if (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE) { + if (GLOBAL_FUNCTION_TABLE && (compiler_globals->function_table != GLOBAL_FUNCTION_TABLE)) { zend_hash_destroy(compiler_globals->function_table); free(compiler_globals->function_table); } - if (compiler_globals->class_table != GLOBAL_CLASS_TABLE) { + if (GLOBAL_CLASS_TABLE && (compiler_globals->class_table != GLOBAL_CLASS_TABLE)) { zend_hash_destroy(compiler_globals->class_table); free(compiler_globals->class_table); } - if (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE) { + if (GLOBAL_AUTO_GLOBALS_TABLE && (compiler_globals->auto_globals != GLOBAL_AUTO_GLOBALS_TABLE)) { zend_hash_destroy(compiler_globals->auto_globals); free(compiler_globals->auto_globals); }