* SCM_DEBUG reveals possible goops bugs
@ 2009-05-04 4:14 Mike Gran
2009-05-10 19:44 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Mike Gran @ 2009-05-04 4:14 UTC (permalink / raw)
To: Guile Devel
[-- 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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-10 19:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 4:14 SCM_DEBUG reveals possible goops bugs Mike Gran
2009-05-10 19:44 ` Ludovic Courtès
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).