~ chicken-core (chicken-5) b0d1c77845c38a2e2a52a8ea2ed1b1246e353f24


commit b0d1c77845c38a2e2a52a8ea2ed1b1246e353f24
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Sat Aug 22 18:13:39 2015 +0200
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Sat Aug 22 19:37:26 2015 +0200

    C_call_with_values: fetch args after checking argc
    
    Conflicts:
            runtime.c

diff --git a/runtime.c b/runtime.c
index c2db4815..fb83f350 100644
--- a/runtime.c
+++ b/runtime.c
@@ -7314,13 +7314,16 @@ void C_ccall C_call_with_values(C_word c, C_word *av)
   C_word
     /* closure = av[ 0 ] */
     k = av[ 1 ],
-    thunk = av[ 2 ],
-    kont = av[ 3 ],
+    thunk,
+    kont,
     *a = C_alloc(C_SIZEOF_CLOSURE(3)),
     kk;
 
   if(c != 4) C_bad_argc(c, 4);
 
+  thunk = av[ 2 ];
+  kont = av[ 3 ];
+
   if(C_immediatep(thunk) || C_header_bits(thunk) != C_CLOSURE_TYPE)
     barf(C_BAD_ARGUMENT_TYPE_ERROR, "call-with-values", thunk);
 
Trap