fix to procedure-arity in previous patch
authorAndy Wingo <wingo@pobox.com>
Sun, 18 Mar 2012 19:14:27 +0000 (20:14 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 18 Mar 2012 19:14:27 +0000 (20:14 +0100)
* libguile/procprop.c (scm_i_procedure_arity): Fix infinite loop.

libguile/procprop.c

index 8e234ed..ff4648d 100644 (file)
@@ -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;