From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.lisp.guile.devel Subject: Re: compiling with -DSCM_DEBUG=1 Date: Sat, 5 Sep 2009 19:42:49 -0400 Message-ID: <86DCB6A5-5CBD-4779-8FEE-7DFD345C9775@raeburn.org> References: <87ljky5ug4.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1252194210 11499 80.91.229.12 (5 Sep 2009 23:43:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Sep 2009 23:43:30 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Sep 06 01:43:23 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mk4ue-000753-9x for guile-devel@m.gmane.org; Sun, 06 Sep 2009 01:43:20 +0200 Original-Received: from localhost ([127.0.0.1]:46261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mk4ud-0003NM-CI for guile-devel@m.gmane.org; Sat, 05 Sep 2009 19:43:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mk4uY-0003NH-1g for guile-devel@gnu.org; Sat, 05 Sep 2009 19:43:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mk4uT-0003N1-8T for guile-devel@gnu.org; Sat, 05 Sep 2009 19:43:13 -0400 Original-Received: from [199.232.76.173] (port=56670 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mk4uT-0003Mv-61 for guile-devel@gnu.org; Sat, 05 Sep 2009 19:43:09 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:51801 helo=raeburn.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mk4uE-0003o8-Fb for guile-devel@gnu.org; Sat, 05 Sep 2009 19:43:08 -0400 Original-Received: from [10.0.0.172] (squish.raeburn.org [10.0.0.172]) by raeburn.org (8.14.3/8.14.1) with ESMTP id n85NgnVW017474; Sat, 5 Sep 2009 19:42:49 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.936) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9268 Archived-At: Okay, I found some more time to look into it. I have a patch that now passes "make && make install && make check" with SCM_DEBUG==1. There was an additional issue in goops.c where SCM_C[AD]R get used with objects that have just been verified to be structs, not pairs. Since there don't seem to be high-level macros for modifying those fields, I used the low-level cell-word access macros instead. Ken Fix run-time errors in building and tests with SCM_DEBUG==1. * eval.i.c (CEVAL): Stop comparing arg list and specifiers when out of specifiers. * objects.c (scm_mcache_lookup_cmethod): Likewise. * goops.c (scm_sys_modify_instance, scm_sys_modify_class): Don't use SCM_CAR and SCM_CDR to access fields of a class object. diff --git a/libguile/eval.i.c b/libguile/eval.i.c index 25abf6c..c9d3beb 100644 --- a/libguile/eval.i.c +++ b/libguile/eval.i.c @@ -847,7 +847,7 @@ dispatch: { SCM args = arg1; /* list of arguments */ z = SCM_SIMPLE_VECTOR_REF (method_cache, hash_value); - while (!scm_is_null (args)) + while (scm_is_pair (z) && !scm_is_null (args)) { /* More arguments than specifiers => CLASS != ENV */ SCM class_of_arg = scm_class_of (SCM_CAR (args)); diff --git a/libguile/goops.c b/libguile/goops.c index d1beab3..eecb652 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -1652,12 +1652,13 @@ SCM_DEFINE (scm_sys_modify_instance, "%modify- instance", 2, 0, 0, */ SCM_CRITICAL_SECTION_START; { - SCM car = SCM_CAR (old); - SCM cdr = SCM_CDR (old); - SCM_SETCAR (old, SCM_CAR (new)); - SCM_SETCDR (old, SCM_CDR (new)); - SCM_SETCAR (new, car); - SCM_SETCDR (new, cdr); + scm_t_bits word0, word1; + word0 = SCM_CELL_WORD_0 (old); + word1 = SCM_CELL_WORD_1 (old); + SCM_SET_CELL_WORD_0 (old, SCM_CELL_WORD_0 (new)); + SCM_SET_CELL_WORD_1 (old, SCM_CELL_WORD_1 (new)); + SCM_SET_CELL_WORD_0 (new, word0); + SCM_SET_CELL_WORD_1 (new, word1); } SCM_CRITICAL_SECTION_END; return SCM_UNSPECIFIED; @@ -1674,13 +1675,14 @@ SCM_DEFINE (scm_sys_modify_class, "%modify- class", 2, 0, 0, SCM_CRITICAL_SECTION_START; { - SCM car = SCM_CAR (old); - SCM cdr = SCM_CDR (old); - SCM_SETCAR (old, SCM_CAR (new)); - SCM_SETCDR (old, SCM_CDR (new)); + scm_t_bits word0, word1; + word0 = SCM_CELL_WORD_0 (old); + word1 = SCM_CELL_WORD_1 (old); + SCM_SET_CELL_WORD_0 (old, SCM_CELL_WORD_0 (new)); + SCM_SET_CELL_WORD_1 (old, SCM_CELL_WORD_1 (new)); SCM_STRUCT_DATA (old)[scm_vtable_index_vtable] = SCM_UNPACK (old); - SCM_SETCAR (new, car); - SCM_SETCDR (new, cdr); + SCM_SET_CELL_WORD_0 (new, word0); + SCM_SET_CELL_WORD_1 (new, word1); SCM_STRUCT_DATA (new)[scm_vtable_index_vtable] = SCM_UNPACK (new); } SCM_CRITICAL_SECTION_END; diff --git a/libguile/objects.c b/libguile/objects.c index e82fb9d..7f20899 100644 --- a/libguile/objects.c +++ b/libguile/objects.c @@ -131,7 +131,7 @@ scm_mcache_lookup_cmethod (SCM cache, SCM args) long j = n; z = SCM_SIMPLE_VECTOR_REF (methods, i); ls = args; /* list of arguments */ - if (!scm_is_null (ls)) + if (!scm_is_null (ls) && scm_is_pair (z)) do { /* More arguments than specifiers => CLASS != ENV */ @@ -140,7 +140,7 @@ scm_mcache_lookup_cmethod (SCM cache, SCM args) ls = SCM_CDR (ls); z = SCM_CDR (z); } - while (j-- && !scm_is_null (ls)); + while (j-- && !scm_is_null (ls) && scm_is_pair (z)); /* Fewer arguments than specifiers => CAR != CLASS or `no- method' */ if (!scm_is_pair (z) || (!SCM_CLASSP (SCM_CAR (z)) && !scm_is_symbol (SCM_CAR (z))))