From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.bugs Subject: Re: segfault on incorrect code Date: Sat, 14 Feb 2004 10:07:29 +1000 Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Message-ID: <8765ear0am.fsf@zip.com.au> References: <2004-01-22-17-49-52+19695+adl@gnu.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1076717455 13309 80.91.224.253 (14 Feb 2004 00:10:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2004 00:10:55 +0000 (UTC) Cc: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Feb 14 01:10:47 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ArnOR-0004Kr-00 for ; Sat, 14 Feb 2004 01:10:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ArnMQ-0003ge-Ma for guile-bugs@m.gmane.org; Fri, 13 Feb 2004 19:08:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ArnMH-0003dI-Ae for bug-guile@gnu.org; Fri, 13 Feb 2004 19:08:33 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ArnLk-0003Oz-4r for bug-guile@gnu.org; Fri, 13 Feb 2004 19:08:31 -0500 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ArnLj-0003IN-8l for bug-guile@gnu.org; Fri, 13 Feb 2004 19:07:59 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1E07rLE001341; Sat, 14 Feb 2004 11:07:53 +1100 Original-Received: from localhost (ppp182.dyn249.pacific.net.au [203.143.249.182]) by mailproxy2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1E07ecg021855; Sat, 14 Feb 2004 11:07:49 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1ArnLF-0000Mx-00; Sat, 14 Feb 2004 10:07:29 +1000 Original-To: Alexandre Duret-Lutz User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GUILE, GNU's Ubiquitous Extension Language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.bugs:1166 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.bugs:1166 --=-=-= Alexandre Duret-Lutz 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. --=-=-= Content-Disposition: inline; filename=sort.c.formals.diff --- 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; } --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://mail.gnu.org/mailman/listinfo/bug-guile --=-=-=--