summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2001-09-10 00:07:32 +0000
committerZeev Suraski <zeev@php.net>2001-09-10 00:07:32 +0000
commitb06440bceb640f943a40dff4e778b7603fb6f266 (patch)
tree11829682cf47713214f3bc95f22bbdb915ff5c76 /Zend/zend_execute_API.c
parent517bd3018c5f4347b2df2b191f6decabd19d78f4 (diff)
downloadphp-git-b06440bceb640f943a40dff4e778b7603fb6f266.tar.gz
MFZE1 (support return value in execute_scripts)
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 2a0b042e03..abacd87026 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -121,8 +121,7 @@ void init_executor(TSRMLS_D)
#if 0&&ZEND_DEBUG
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
#endif
- EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
- EG(global_return_value_ptr) = NULL;
+ EG(return_value_ptr_ptr) = NULL;
EG(symtable_cache_ptr) = EG(symtable_cache)-1;
EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1;
@@ -608,6 +607,7 @@ void execute_new_code(TSRMLS_D)
{
zend_op *opline, *end;
zend_op *ret_opline;
+ zval *local_retval=NULL;
if (!CG(interactive)
|| CG(active_op_array)->backpatch_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;
}