From 1d225c1885a2daea8ee91ee2359e53b0cf13744e Mon Sep 17 00:00:00 2001 From: Xuefer Date: Fri, 4 Jan 2008 11:20:05 +0000 Subject: [PATCH] shallow copy for some compiler result infos git-svn-id: svn://svn.lighttpd.net/xcache/trunk@495 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- processor/processor.m4 | 14 +++++++++++--- xcache.c | 7 ++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/processor/processor.m4 b/processor/processor.m4 index ef7f780..e17231a 100644 --- a/processor/processor.m4 +++ b/processor/processor.m4 @@ -763,7 +763,11 @@ DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{ #ifdef HAVE_XCACHE_CONSTANT DISPATCH(zend_uint, constinfo_cnt) - STRUCT_ARRAY(constinfo_cnt, xc_constinfo_t, constinfos) + IFRESTORE(` + COPY(constinfos) + ', ` + STRUCT_ARRAY(constinfo_cnt, xc_constinfo_t, constinfos) + ') #endif DISPATCH(zend_uint, funcinfo_cnt) @@ -776,12 +780,16 @@ DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{ ') ') STRUCT_ARRAY(classinfo_cnt, xc_classinfo_t, classinfos) + popdef(`BEFORE_LOOP') #ifdef ZEND_ENGINE_2_1 DISPATCH(zend_uint, autoglobal_cnt) - STRUCT_ARRAY(autoglobal_cnt, xc_autoglobal_t, autoglobals) + IFRESTORE(` + COPY(autoglobals) + ', ` + STRUCT_ARRAY(autoglobal_cnt, xc_autoglobal_t, autoglobals) + ') #endif DISPATCH(zend_bool, have_early_binding) - popdef(`BEFORE_LOOP') DISPATCH(zend_bool, have_references) ') dnl }}} diff --git a/xcache.c b/xcache.c index fc564eb..bb88a6f 100644 --- a/xcache.c +++ b/xcache.c @@ -1165,7 +1165,12 @@ static zend_op_array *xc_compile_restore(xc_entry_t *stored_xce, zend_file_handl catched = 1; } zend_end_try(); - xc_free_php(&php TSRMLS_CC); + if (php.funcinfos) { + efree(php.funcinfos); + } + if (php.classinfos) { + efree(php.classinfos); + } if (catched) { zend_bailout();