cvs: pecl /bcompiler bcompiler.c
| From: | val khokhlov | Date: | Fri, 10 Jun 2005 15:44:25 +0000 |
| Subject: | cvs: pecl /bcompiler bcompiler.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-3258@lists.php.net to get a copy of this message | ||
val Fri Jun 10 11:44:25 2005 EDT
Modified files:
/pecl/bcompiler bcompiler.c
Log:
use zend_do_inheritance for php5 (fixes some bugs with classes/exceptions)
http://cvs.php.net/diff.php/pecl/bcompiler/bcompiler.c?r1=1.89&r2=1.90&ty=u
Index: pecl/bcompiler/bcompiler.c
diff -u pecl/bcompiler/bcompiler.c:1.89 pecl/bcompiler/bcompiler.c:1.90
--- pecl/bcompiler/bcompiler.c:1.89 Sun Apr 24 15:13:20 2005
+++ pecl/bcompiler/bcompiler.c Fri Jun 10 11:44:25 2005
@@ -20,7 +20,7 @@
| Mike Bretz <mike@metropolis-ag.de> |
+----------------------------------------------------------------------+
*/
-/* $Id: bcompiler.c,v 1.89 2005/04/24 19:13:20 val Exp $ */
+/* $Id: bcompiler.c,v 1.90 2005/06/10 15:44:25 val Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1688,10 +1688,8 @@
#endif
-
-
+#ifndef ZEND_ENGINE_2
/* copy of zend_do_inheritance */
-
void bcompiler_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
{
zend_function tmp_zend_function;
@@ -1701,45 +1699,40 @@
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void
(*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *))
function_add_ref, &tmp_zend_function, sizeof(zend_function), 0);
ce->parent = parent_ce;
-#ifndef ZEND_ENGINE_2
if (!ce->handle_property_get)
ce->handle_property_get = parent_ce->handle_property_get;
if (!ce->handle_property_set)
ce->handle_property_set = parent_ce->handle_property_set;
if (!ce->handle_function_call)
ce->handle_function_call = parent_ce->handle_function_call;
-#endif
/* leave this out for the time being? - inherit constructor.. */
/* do_inherit_parent_constructor(ce); */
}
-
-
-
-
+#endif
/* inherit: recursively inherit methods from base to all the children
* of parent, the children of parent's children, and so on */
-
-
-
-
static void bcompiler_inherit(zend_class_entry* base TSRMLS_DC)
{
zend_class_entry* child;
- BCOMPILER_DEBUG(("parent class: %s\n",base->name));
+ BCOMPILER_DEBUG(("parent class: %s\n", base->name));
if (!base->parent) {
return; // 'parent' has no children, nothing to do
}
child = base->parent;
- while(child) {
- BCOMPILER_DEBUG(("child class: %s\n",child->name));
- bcompiler_do_inheritance(base,child);
- child = child->parent;
+ while (child) {
+ BCOMPILER_DEBUG(("child class: %s\n", child->name));
+#ifndef ZEND_ENGINE_2
+ bcompiler_do_inheritance(base, child);
+#else
+ zend_do_inheritance(base, child);
+#endif
+ child = child->parent;
}
}
@@ -2394,6 +2387,7 @@
void apc_create_zval(zval** zv TSRMLS_DC)
{
*zv = (zval*) emalloc(sizeof(zval));
+ memset(*zv, 0, sizeof(zval));
apc_deserialize_zval(*zv, NULL TSRMLS_CC);
}
void apc_free_zval(zval** zv TSRMLS_DC)