From b06440bceb640f943a40dff4e778b7603fb6f266 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Mon, 10 Sep 2001 00:07:32 +0000 Subject: [PATCH] MFZE1 (support return value in execute_scripts) --- Zend/zend.c | 11 +++++------ Zend/zend_execute_API.c | 10 +++++++--- Zend/zend_globals.h | 3 --- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Zend/zend.c b/Zend/zend.c index 6eb3e931b6..56e50c082d 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -794,6 +794,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co int i; zend_file_handle *file_handle; zend_op_array *orig_op_array = EG(active_op_array); + zval *local_retval=NULL; va_start(files, file_count); for (i=0; ibackpatch_count>0 @@ -641,9 +641,13 @@ void execute_new_code(TSRMLS_D) opline++; } + EG(return_value_ptr_ptr) = &local_retval; EG(active_op_array) = CG(active_op_array); zend_execute(CG(active_op_array) TSRMLS_CC); - zval_ptr_dtor(EG(return_value_ptr_ptr)); + if (local_retval) { + zval_ptr_dtor(&local_retval); + } + CG(active_op_array)->last--; /* get rid of that ZEND_RETURN */ CG(active_op_array)->start_op = CG(active_op_array)->opcodes+CG(active_op_array)->last; } diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 814f65be77..d3132e2b7a 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -143,9 +143,6 @@ struct _zend_executor_globals { zend_function_state *function_state_ptr; zend_ptr_stack arg_types_stack; - /* for global return() support */ - zval *global_return_value_ptr; - /* symbol table cache */ HashTable *symtable_cache[SYMTABLE_CACHE_SIZE]; HashTable **symtable_cache_limit; -- 2.50.1