diff options
author | Andy Wingo <wingo@pobox.com> | 2008-09-30 22:50:48 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-09-30 22:50:48 +0200 |
commit | 887ce75ae828fabd9a76d8e719bd3070c334eb44 (patch) | |
tree | ac57ad2416a186874d2cfc312ffa4dc029a10864 /libguile/vm-i-system.c | |
parent | 999f1b26e74a7a8eb9e9e5e479f971e145aa7326 (diff) | |
download | guile-887ce75ae828fabd9a76d8e719bd3070c334eb44.tar.gz |
fix some missed references when calling C functions
* gdbinit: Update to be a bit more useful.
* libguile/vm-i-system.c: Make sure that arguments to C procedures are
visible on the stack so they get marked. Could be a source for the
missed references.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r-- | libguile/vm-i-system.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 87d3a533a..46075c017 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -558,12 +558,12 @@ VM_DEFINE_INSTRUCTION (call, "call", 1, -1, 1) { /* At this point, the stack contains the procedure and each one of its arguments. */ - SCM args; POP_LIST (nargs); - POP (args); SYNC_REGISTER (); - *sp = scm_apply (x, args, SCM_EOL); + /* keep args on stack so they are marked */ + sp[-1] = scm_apply (x, sp[0], SCM_EOL); /* FIXME what if SCM_VALUESP(*sp) */ + DROP (); NEXT; } /* @@ -729,11 +729,10 @@ VM_DEFINE_INSTRUCTION (goto_args, "goto/args", 1, -1, 1) */ if (!SCM_FALSEP (scm_procedure_p (x))) { - SCM args; POP_LIST (nargs); - POP (args); SYNC_REGISTER (); - *sp = scm_apply (x, args, SCM_EOL); + sp[-1] = scm_apply (x, sp[0], SCM_EOL); + DROP (); /* FIXME what if SCM_VALUESP(*sp) */ goto vm_return; } @@ -798,11 +797,10 @@ VM_DEFINE_INSTRUCTION (mv_call, "mv-call", 3, -1, 1) { /* At this point, the stack contains the procedure and each one of its arguments. */ - SCM args; POP_LIST (nargs); - POP (args); SYNC_REGISTER (); - *sp = scm_apply (x, args, SCM_EOL); + sp[-1] = scm_apply (x, sp[0], SCM_EOL); + DROP (); if (SCM_VALUESP (*sp)) { SCM values, len; |