]> granicus.if.org Git - php/commitdiff
- Add support for used_return_value passed to internal functions.
authorAndi Gutmans <andi@php.net>
Tue, 16 Nov 1999 18:30:06 +0000 (18:30 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 16 Nov 1999 18:30:06 +0000 (18:30 +0000)
Zend/zend.h
Zend/zend_compile.c
Zend/zend_execute.c

index 9e190e46412fd3fb097299ed02cbdeb17e3e7a0c..dedb1e45b47073b4bcead29da79be5d8930a5c86 100644 (file)
@@ -96,8 +96,8 @@ typedef unsigned char zend_bool;
 #include "zend_hash.h"
 #include "zend_llist.h"
 
-#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, HashTable *list, HashTable *plist, zval *this_ptr
-#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, list, plist, this_ptr
+#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, HashTable *list, HashTable *plist, zval *this_ptr, char used_return_value
+#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, list, plist, this_ptr, used_return_value
 
 /*
  * zval
index e1390590b4058a990850ebf69cff44d0e41c4d01..8e37655b6ab9fdc2dd7ba7ba383b87358b7982a9 100644 (file)
@@ -622,11 +622,17 @@ void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
 void do_free(znode *op1 CLS_DC)
 {
        if (op1->op_type==IS_TMP_VAR) {
-               zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
+               zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
 
-               opline->opcode = ZEND_FREE;
-               opline->op1 = *op1;
-               SET_UNUSED(opline->op2);
+               if ((opline->opcode == ZEND_DO_FCALL) || (opline->opcode == ZEND_DO_FCALL_BY_NAME)) {
+                       opline->result.u.EA.type |= EXT_TYPE_UNUSED;
+               } else {
+                       zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
+
+                       opline->opcode = ZEND_FREE;
+                       opline->op1 = *op1;
+                       SET_UNUSED(opline->op2);
+               }
        } else if (op1->op_type==IS_VAR) {
                zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
 
index 5123d9890d652192a2f9395a62358073714f9d21..b5f6c16079543187b5cd7043117718e1a56cbce4 100644 (file)
@@ -882,7 +882,7 @@ static void call_overloaded_function(int arg_count, zval *return_value, HashTabl
        zend_property_reference *property_reference;
 
        zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
-       (property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, list, plist, property_reference->object, property_reference);
+       (property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, list, plist, property_reference->object, 0, property_reference);
        zend_llist_destroy(&property_reference->elements_list);
 
        zend_stack_del_top(&EG(overloaded_objects_stack));
@@ -1468,7 +1468,7 @@ do_fcall_common:
                                        zend_ptr_stack_push(&EG(argument_stack), (void *) opline->extended_value);
                                        if (function_state.function->type==ZEND_INTERNAL_FUNCTION) {
                                                var_uninit(&Ts[opline->result.u.var].tmp_var);
-                                               ((zend_internal_function *) function_state.function)->handler(opline->extended_value, &Ts[opline->result.u.var].tmp_var, &EG(regular_list), &EG(persistent_list), object.ptr);
+                                               ((zend_internal_function *) function_state.function)->handler(opline->extended_value, &Ts[opline->result.u.var].tmp_var, &EG(regular_list), &EG(persistent_list), object.ptr, (opline->result.u.EA.type ^ EXT_TYPE_UNUSED));
                                                if (object.ptr) {
                                                        object.ptr->refcount--;
                                                }