unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Cc: bug-guile@gnu.org
Subject: Re: segfault on incorrect code
Date: Sat, 14 Feb 2004 10:07:29 +1000	[thread overview]
Message-ID: <8765ear0am.fsf@zip.com.au> (raw)
In-Reply-To: 2004-01-22-17-49-52+19695+adl@gnu.org

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

Alexandre Duret-Lutz <Alexandre.Duret-Lutz@lip6.fr> writes:
>
> guile> (define (foo a b c) (< b c))
> guile> (sort '(3 2 1) foo)

Thanks.

I get some joy from the change below, but someone smarter than me will
need to verify that it's the right approach.  The "if" conditions are
cut and pasted from scm_trampoline_2 in the cvs head.


[-- Attachment #2: sort.c.formals.diff --]
[-- Type: text/plain, Size: 741 bytes --]

--- sort.c.~1.36.2.4.~	2002-03-15 20:33:37.000000000 +1000
+++ sort.c	2004-02-13 09:38:23.000000000 +1000
@@ -401,7 +401,18 @@
     case scm_tc7_lsubr:
       return lsubrless;
     case scm_tcs_closures:
-      return closureless;
+      {
+	SCM formals = SCM_CLOSURE_FORMALS (p);
+        if (!SCM_NULLP (formals)
+            && (!SCM_CONSP (formals)
+                || (!SCM_NULLP (SCM_CDR (formals))
+                    && (!SCM_CONSP (SCM_CDR (formals))
+                        || !SCM_CONSP (SCM_CDDR (formals))))))
+          return closureless;
+      }
+      /* invalid formal parameters, return applyless and let scm_call_2
+         there report the error */
+      /*FALLTHRU*/
     default:
       return applyless;
     }

[-- Attachment #3: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile

  parent reply	other threads:[~2004-02-14  0:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 16:49 segfault on incorrect code Alexandre Duret-Lutz
2004-02-13  0:11 ` Marius Vollmer
2004-02-14  0:07 ` Kevin Ryde [this message]
2004-02-14  0:33   ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8765ear0am.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --cc=bug-guile@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).