]> granicus.if.org Git - php/commitdiff
Closure::fromCallable(): Fix stack corruption
authorNikita Popov <nikic@php.net>
Tue, 5 Jul 2016 12:53:20 +0000 (14:53 +0200)
committerNikita Popov <nikic@php.net>
Tue, 5 Jul 2016 12:54:35 +0000 (14:54 +0200)
So the tests work at least...

Zend/zend_closures.c

index 8d101ddcc886f50aa4e3004e666257df3448f82f..5c5e8a6cb519d3d4d100fc4121ecd4080f2639ee 100644 (file)
@@ -269,6 +269,7 @@ static int zend_create_closure_from_callable(zval *return_value, zval *callable,
        zend_fcall_info_cache fcc;
        zend_function *mptr;
        zval instance;
+       zend_internal_function call;
 
        if (!zend_is_callable_ex(callable, NULL, 0, NULL, &fcc, error)) {
                return FAILURE;
@@ -280,7 +281,6 @@ static int zend_create_closure_from_callable(zval *return_value, zval *callable,
        }
 
        if (mptr->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
-               zend_internal_function call;
                memset(&call, 0, sizeof(zend_internal_function));
 
                call.type = ZEND_INTERNAL_FUNCTION;