diff options
author | Andy Wingo <wingo@pobox.com> | 2012-03-18 20:14:27 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-03-18 20:14:27 +0100 |
commit | 01e909d90a130f4987b70edae2dbd5a2b33edae7 (patch) | |
tree | fba3ae108895529ba73ac8fa12981ccdd373df96 /libguile/procprop.c | |
parent | 80be163f81e0dcc16e6805d4c2d1f2de3ca38c55 (diff) | |
download | guile-01e909d90a130f4987b70edae2dbd5a2b33edae7.tar.gz |
fix to procedure-arity in previous patch
* libguile/procprop.c (scm_i_procedure_arity): Fix infinite loop.
Diffstat (limited to 'libguile/procprop.c')
-rw-r--r-- | libguile/procprop.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libguile/procprop.c b/libguile/procprop.c index 8e234edbd..ff4648d00 100644 --- a/libguile/procprop.c +++ b/libguile/procprop.c @@ -72,11 +72,15 @@ scm_i_procedure_arity (SCM proc, int *req, int *opt, int *rest) { if (!SCM_SMOB_APPLICABLE_P (proc)) return 0; - if (scm_i_program_arity (SCM_SMOB_DESCRIPTOR (proc).apply_trampoline, - req, opt, rest)) - /* The trampoline gets the smob too, which users don't - see. */ - *req -= 1; + if (!scm_i_program_arity (SCM_SMOB_DESCRIPTOR (proc).apply_trampoline, + req, opt, rest)) + return 0; + + /* The trampoline gets the smob too, which users don't + see. */ + *req -= 1; + + return 1; } else return 0; |