]> granicus.if.org Git - php/commitdiff
Fix argument unpacking
authorNikita Popov <nikic@php.net>
Fri, 11 Apr 2014 17:53:14 +0000 (19:53 +0200)
committerNikita Popov <nikic@php.net>
Fri, 11 Apr 2014 17:53:14 +0000 (19:53 +0200)
Zend/zend_execute.c

index e4090081a6d506f2c81abe46b73623cc5775bf30..1fb209a650375b3b446f0093ba44e47975ac5a2b 100644 (file)
@@ -1690,6 +1690,7 @@ static zval *zend_vm_stack_push_args_with_copy(int count TSRMLS_DC) /* {{{ */
        ZVAL_LONG(EG(argument_stack)->top, count);
        while (count-- > 0) {
                zval *data = --p->top;
+               ZVAL_COPY_VALUE(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + count, data);
 
                if (UNEXPECTED(p->top == ZEND_VM_STACK_ELEMETS(p))) {
                        zend_vm_stack r = p;
@@ -1698,7 +1699,6 @@ static zval *zend_vm_stack_push_args_with_copy(int count TSRMLS_DC) /* {{{ */
                        p = p->prev;
                        efree(r);
                }
-               ZVAL_COPY_VALUE(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + count, data);
        }
        return EG(argument_stack)->top++;
 }