cvs: ZendEngine2 / zend_API.c
| From: | Andrei Zmievski | Date: | Thu, 03 Apr 2003 19:05:26 +0000 |
| Subject: | cvs: ZendEngine2 / zend_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1112@lists.php.net to get a copy of this message | ||
andrei Thu Apr 3 14:05:26 2003 EDT
Modified files:
/ZendEngine2 zend_API.c
Log:
Patch from Timm Friede for when EG(active_namespace) is NULL initially.
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.164 ZendEngine2/zend_API.c:1.165
--- ZendEngine2/zend_API.c:1.164 Thu Apr 3 09:44:41 2003
+++ ZendEngine2/zend_API.c Thu Apr 3 14:05:25 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.164 2003/04/03 14:44:41 andrei Exp $ */
+/* $Id: zend_API.c,v 1.165 2003/04/03 19:05:25 andrei Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -1388,6 +1388,8 @@
{
zend_class_entry *register_class;
zend_namespace *orig_namespace = NULL;
+ HashTable *orig_class_table = NULL;
+ int restore_orig = 0;
if (!ns && ns_name) {
zend_namespace **pns;
@@ -1404,16 +1406,18 @@
}
if (EG(active_namespace) != ns) {
+ restore_orig = 1;
orig_namespace = EG(active_namespace);
EG(active_namespace) = ns;
+ orig_class_table = CG(class_table);
CG(class_table) = &ns->class_table;
}
register_class = zend_register_internal_class_ex(class_entry, parent_ce, NULL TSRMLS_CC);
- if (orig_namespace) {
+ if (restore_orig) {
EG(active_namespace) = orig_namespace;
- CG(class_table) = &orig_namespace->class_table;
+ CG(class_table) = orig_class_table;
}
-
+
return register_class;
}