Skip to content
Browse files

- Fix bug introduced with latest class hash table change.

  • Loading branch information...
1 parent e96dd60 commit c8c629b3fcc1e531863b726faac843a3d8dde80d @andigutmans andigutmans committed Mar 12, 2002
Showing with 5 additions and 5 deletions.
  1. +1 −1 Zend/zend_compile.c
  2. +1 −1 Zend/zend_compile.h
  3. +1 −1 Zend/zend_execute.c
  4. +2 −2 Zend/zend_opcode.c
View
2 Zend/zend_compile.c
@@ -2048,7 +2048,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
CG(active_ce_parent_class_name).value.str.val = estrndup(parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len);
CG(active_ce_parent_class_name).value.str.len = parent_class_name->u.constant.value.str.len;
- if (zend_hash_find(CG(active_class_entry)?&CG(active_class_entry)->class_table:CG(class_table), parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class)==SUCCESS) {
+ if (zend_hash_find(CG(active_class_entry)?&CG(active_class_entry)->class_table:CG(class_table), parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class_p)==SUCCESS) {
parent_class = *parent_class_p;
/* copy functions */
zend_hash_copy(&new_class_entry->function_table, &parent_class->function_table, (copy_ctor_func_t) function_add_ref, &tmp_zend_function, sizeof(zend_function));
View
2 Zend/zend_compile.h
@@ -388,7 +388,7 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh);
ZEND_API void destroy_zend_function(zend_function *function);
ZEND_API void destroy_zend_class(zend_class_entry **pce);
-void zend_class_add_ref(zend_class_entry *ce);
+void zend_class_add_ref(zend_class_entry **ce);
#define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
View
2 Zend/zend_execute.c
@@ -1754,7 +1754,7 @@ binary_assign_op_addr: {
if (zend_hash_add(EG(class_table), class_name_strval, class_name_strlen + 1, import_ce, sizeof(zend_class_entry *), NULL) == FAILURE) {
zend_error(E_ERROR, "Import: class %s already exists in current scope", class_name_strval);
}
- zend_class_add_ref(*import_ce);
+ zend_class_add_ref(import_ce);
} else {
zend_class_entry *tmp_zend_class_entry;
View
4 Zend/zend_opcode.c
@@ -142,9 +142,9 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
}
-void zend_class_add_ref(zend_class_entry *ce)
+void zend_class_add_ref(zend_class_entry **ce)
{
- (*ce->refcount)++;
+ (*(*ce)->refcount)++;
}

0 comments on commit c8c629b

Please sign in to comment.
Something went wrong with that request. Please try again.