]> granicus.if.org Git - php/commitdiff
Revered func_get_args() changes, because they were not completly transparent and...
authorDmitry Stogov <dmitry@zend.com>
Tue, 10 Dec 2013 12:02:59 +0000 (16:02 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 10 Dec 2013 12:02:59 +0000 (16:02 +0400)
Zend/zend_builtin_functions.c

index 6cbe0bc6872a5a9756df7389c37b9b5ec78b38f2..1ad64e74eaf4772ca866cef6d7a30b12ccd74615 100644 (file)
@@ -461,17 +461,12 @@ ZEND_FUNCTION(func_get_args)
 
        array_init_size(return_value, arg_count);
        for (i=0; i<arg_count; i++) {
-               zval *element, *arg;
+               zval *element;
 
-               arg = *((zval **) (p-(arg_count-i)));
-               if (!Z_ISREF_P(arg)) {
-                       element = arg;
-                       Z_ADDREF_P(element);
-               } else {
-                       ALLOC_ZVAL(element);
-                       INIT_PZVAL_COPY(element, arg);
-                       zval_copy_ctor(element);
-           }
+               ALLOC_ZVAL(element);
+               *element = **((zval **) (p-(arg_count-i)));
+               zval_copy_ctor(element);
+               INIT_PZVAL(element);
                zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL);
        }
 }