summaryrefslogtreecommitdiff
path: root/processor
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-11-10 13:24:52 +0000
committerXuefer <xuefer@gmail.com>2014-11-10 13:24:52 +0000
commit49e586053c40eb367f90a464818111df867c0625 (patch)
tree2cc793a1e1ef851ab9b95689e7195ee69815c5e7 /processor
parent51accff949c03c54a1f5fef4c54e2aa61feb00ba (diff)
downloadxcache-49e586053c40eb367f90a464818111df867c0625.tar.gz
xcache-49e586053c40eb367f90a464818111df867c0625.zip
PHP4: fix object handling
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1562 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor')
-rw-r--r--processor/var-helper.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/processor/var-helper.h b/processor/var-helper.h
index 700dfb4..92feb22 100644
--- a/processor/var-helper.h
+++ b/processor/var-helper.h
@@ -44,7 +44,8 @@ static void xc_var_collect_class(xc_processor_t *processor, zend_class_entry *ce
zend_hash_init(&processor->class_name_to_index, 0, NULL, NULL, 0);
}
- next_index = xc_vector_size(&processor->class_names);
+ /* HashTable <=PHP_4 cannot handle NULL pointers, +1 needed */
+ next_index = xc_vector_size(&processor->class_names) + 1;
if (zend_hash_add(&processor->class_name_to_index, ce->name, ce->name_length, (void *) &next_index, sizeof(next_index), NULL) == SUCCESS) {
xc_constant_string_t class_name;
class_name.str = (char *) ce->name;
@@ -59,10 +60,10 @@ static size_t xc_var_store_ce(xc_processor_t *processor, zend_class_entry *ce TS
if (zend_hash_find(&processor->class_name_to_index, ce->name, ce->name_length, (void **) &index) != SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_CORE_ERROR, "Internal error: class name not found in class names");
- return (size_t) -1;
+ return (size_t) - 1;
}
- return *index;
+ return *index - 1;
}
/* }}} */
/* on restore */