unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mike Gran <spk121@yahoo.com>
To: Guile Devel <guile-devel@gnu.org>
Subject: SCM_DEBUG reveals possible goops bugs
Date: Sun, 03 May 2009 21:14:39 -0700	[thread overview]
Message-ID: <1241410479.21077.2255.camel@localhost.localdomain> (raw)

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

Here are some things I've noticed.  I don't know what to make of them,
but, I wanted to jot them down before I forgot them.

1. When compiled with -DSCM_DEBUG, build fails because of invalid lvalue
assignment in programs.c.  Easy fix.  See attached patches to
program.[ch].

2. When compiled with -DSCM_DEBUG, the "fraction generics" test in
fractions.test fails with a "Non-pair accessed with SCM_C[AD]R:
`#<program 91ad670 (class . initargs)>'"

3. Likewise, the "interaction with `struct-ref'" in goops.test fails
with "Non-pair accessed with SCM_C[AD]R: `#<program 90570b0 (class .
initargs)>'"

4. Similar in goops.test for "interaction with `struct-set!",
"overwriting a top-level binding to a generic" and others


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1108 bytes --]

diff --git a/libguile/programs.c b/libguile/programs.c
index 8e89829..cb5cbba 100644
--- a/libguile/programs.c
+++ b/libguile/programs.c
@@ -340,7 +340,7 @@ SCM_DEFINE (scm_program_external_set_x, "program-external-set!", 2, 0, 0,
 {
   SCM_VALIDATE_PROGRAM (1, program);
   SCM_VALIDATE_LIST (2, external);
-  SCM_PROGRAM_EXTERNALS (program) = external;
+  SCM_SET_PROGRAM_EXTERNALS (program,external);
   return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
diff --git a/libguile/programs.h b/libguile/programs.h
index 68a6936..6255cb9 100644
--- a/libguile/programs.h
+++ b/libguile/programs.h
@@ -59,6 +59,7 @@ extern scm_t_bits scm_tc16_program;
 #define SCM_PROGRAM_OBJCODE(x)	(SCM_SMOB_OBJECT (x))
 #define SCM_PROGRAM_OBJTABLE(x)	(SCM_SMOB_OBJECT_2 (x))
 #define SCM_PROGRAM_EXTERNALS(x) (SCM_SMOB_OBJECT_3 (x))
+#define SCM_SET_PROGRAM_EXTERNALS(x,obj) (SCM_SET_SMOB_OBJECT_3 (x,obj))
 #define SCM_PROGRAM_DATA(x)	(SCM_OBJCODE_DATA (SCM_PROGRAM_OBJCODE (x)))
 #define SCM_VALIDATE_PROGRAM(p,x) SCM_MAKE_VALIDATE (p, x, PROGRAM_P)
 #define SCM_PROGRAM_IS_BOOT(x)	(SCM_SMOB_FLAGS (x) & SCM_F_PROGRAM_IS_BOOT)

             reply	other threads:[~2009-05-04  4:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04  4:14 Mike Gran [this message]
2009-05-10 19:44 ` SCM_DEBUG reveals possible goops bugs Ludovic Courtès

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=1241410479.21077.2255.camel@localhost.localdomain \
    --to=spk121@yahoo.com \
    --cc=guile-devel@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).