cvs: ZendEngine2 / zend_execute.c

From: Date: Thu, 23 Jan 2003 16:40:31 +0000
Subject: cvs: ZendEngine2 / zend_execute.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-845@lists.php.net to get a copy of this message
zeev Thu Jan 23 11:40:31 2003 EDT Modified files: /ZendEngine2 zend_execute.c Log: Let the scope propagate to internal functions Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.411 ZendEngine2/zend_execute.c:1.412 --- ZendEngine2/zend_execute.c:1.411 Wed Jan 22 09:48:30 2003 +++ ZendEngine2/zend_execute.c Thu Jan 23 11:40:30 2003 @@ -2549,11 +2549,6 @@ int return_value_used = RETURN_VALUE_USED(EX(opline)); zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) EX(opline)->extended_value, NULL); - current_scope = EG(scope); - EG(scope) = EX(calling_scope); - - current_this = EG(This); - EG(This) = EX(object); EX_T(EX(opline)->result.u.var).var.ptr_ptr = &EX_T(EX(opline)->result.u.var).var.ptr; @@ -2577,6 +2572,11 @@ } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { HashTable *calling_symbol_table; + current_this = EG(This); + EG(This) = EX(object); + current_scope = EG(scope); + EG(scope) = EX(calling_scope); + EX_T(EX(opline)->result.u.var).var.ptr = NULL; if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ @@ -2614,6 +2614,11 @@ zend_hash_clean(*EG(symtable_cache_ptr)); } EG(active_symbol_table) = calling_symbol_table; + if (EG(This)) { + zval_ptr_dtor(&EG(This)); + } + EG(This) = current_this; + EG(scope) = current_scope; } else { /* ZEND_OVERLOADED_FUNCTION */ ALLOC_ZVAL(EX_T(EX(opline)->result.u.var).var.ptr); INIT_ZVAL(*(EX_T(EX(opline)->result.u.var).var.ptr)); @@ -2636,14 +2641,6 @@ EG(function_state_ptr) = &EX(function_state); zend_ptr_stack_clear_multiple(TSRMLS_C); - EG(scope) = current_scope; - - if (EG(This)) { - zval_ptr_dtor(&EG(This)); - } - - EG(This) = current_this; - if (EG(exception)) { if (EX(opline)->op2.u.opline_num == -1) { RETURN_FROM_EXECUTE_LOOP(execute_data);

« previous php.zend-engine.cvs (#845) next »