diff --git a/const_string.c b/const_string.c index 759b915..9832baa 100644 --- a/const_string.c +++ b/const_string.c @@ -69,6 +69,8 @@ const char *xc_get_data_type(zend_uchar data_type) # include "const_string_opcodes_php5.1.h" #elif defined(ZEND_ENGINE_2) # include "const_string_opcodes_php5.0.h" +#else +# include "const_string_opcodes_php4.x.h" #endif zend_uchar xc_get_opcode_count() diff --git a/processor/processor.m4 b/processor/processor.m4 index 1c82ec4..8d00efc 100644 --- a/processor/processor.m4 +++ b/processor/processor.m4 @@ -508,8 +508,10 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{ dst->refcount[0] = 1000; /* deep */ STRUCT_P(HashTable, static_variables, HashTable_zval_ptr) +#ifdef ZEND_ENGINE_2 STRUCT_ARRAY_I(num_args, zend_arg_info, arg_info) xc_gc_add_op_array(dst TSRMLS_CC); +#endif define(`SKIPASSERT_ONCE') } else diff --git a/utils.c b/utils.c index f88af50..9c71cf6 100644 --- a/utils.c +++ b/utils.c @@ -786,6 +786,7 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_D /* restore orig here, as EG/CG holded tmp before */ memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files))); +#ifdef E_STRICT if (sandbox->compilererrors) { int i; for (i = 0; i < sandbox->compilererror_cnt; i ++) { @@ -793,6 +794,7 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_D } efree(sandbox->compilererrors); } +#endif if (sandbox->alloc) { efree(sandbox); } diff --git a/xcache.c b/xcache.c index db39b4e..e437ee5 100644 --- a/xcache.c +++ b/xcache.c @@ -1481,6 +1481,7 @@ int xc_is_shm(const void *p) /* {{{ */ } /* }}} */ +#ifdef ZEND_ENGINE_2 /* {{{ xc_gc_op_array_t */ typedef struct { zend_uint num_args; @@ -1492,7 +1493,9 @@ void xc_gc_add_op_array(zend_op_array *op_array TSRMLS_DC) /* {{{ */ xc_gc_op_array_t gc_op_array; gc_op_array.num_args = op_array->num_args; gc_op_array.arg_info = op_array->arg_info; +#ifdef ZEND_ENGINE_2 zend_hash_next_index_insert(&XG(gc_op_arrays), (void *) &gc_op_array, sizeof(gc_op_array), NULL); +#endif } /* }}} */ static void xc_gc_op_array(void *pDest) /* {{{ */ @@ -1510,6 +1513,7 @@ static void xc_gc_op_array(void *pDest) /* {{{ */ } } /* }}} */ +#endif /* module helper function */ static int xc_init_constant(int module_number TSRMLS_DC) /* {{{ */ @@ -1743,7 +1747,9 @@ static void xc_request_init(TSRMLS_D) /* {{{ */ } } +#ifdef ZEND_ENGINE_2 zend_hash_init(&XG(gc_op_arrays), 32, NULL, xc_gc_op_array, 0); +#endif #if PHP_API_VERSION <= 20041225 XG(request_time) = time(NULL); @@ -1759,7 +1765,9 @@ static void xc_request_init(TSRMLS_D) /* {{{ */ static void xc_request_shutdown(TSRMLS_D) /* {{{ */ { xc_entry_unholds(TSRMLS_C); +#ifdef ZEND_ENGINE_2 zend_hash_destroy(&XG(gc_op_arrays)); +#endif xc_gc_expires_php(TSRMLS_C); xc_gc_expires_var(TSRMLS_C); xc_gc_deletes(TSRMLS_C); diff --git a/xcache_globals.h b/xcache_globals.h index a22389b..9de7f26 100644 --- a/xcache_globals.h +++ b/xcache_globals.h @@ -17,7 +17,9 @@ ZEND_BEGIN_MODULE_GLOBALS(xcache) time_t request_time; long var_ttl; +#ifdef ZEND_ENGINE_2 HashTable gc_op_arrays; +#endif HashTable internal_function_table; HashTable internal_class_table;