summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-07-18 16:09:09 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-07-18 16:09:09 +0000
commit62850ef3c14ef9dfa96951a3230cb6fb76084bb2 (patch)
tree48e6af0927d2ab08616840f88c41be2cc52259c6
parentcc4feeca51e8b9f2883cfd0efb51092e6a014b4c (diff)
downloadguile-62850ef3c14ef9dfa96951a3230cb6fb76084bb2.tar.gz
* Don't use return value from SCM_SETCDR or SCM_WHASHSET.
-rw-r--r--libguile/ChangeLog6
-rw-r--r--libguile/read.c17
-rw-r--r--libguile/srcprop.c32
3 files changed, 33 insertions, 22 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index 880fd9632..51aab8bd5 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,5 +1,11 @@
2000-07-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
+ read.c (scm_lreadrecparen), srcprop.c (scm_set_source_property_x):
+ SCM_SETCDR and SCM_WHASHSET macros don't deliver a return value.
+ Thanks to Han-Wen Nienhuys for the bug report.
+
+2000-07-18 Dirk Herrmann <D.Herrmann@tu-bs.de>
+
* root.[ch] (scm_call_catching_errors): Deprecated.
* root.c (scm_init_root): Initialize the root smob type using the
diff --git a/libguile/read.c b/libguile/read.c
index 5aa743e69..1fa86009c 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -666,6 +666,8 @@ scm_lreadrecparen (SCM *tok_buf, SCM port, char *name, SCM *copy)
SCM_EOL);
while (')' != (c = scm_flush_ws (port, name)))
{
+ SCM new_tail;
+
scm_ungetc (c, port);
if (SCM_EQ_P (scm_sym_dot, (tmp = scm_lreadr (tok_buf, port, copy))))
{
@@ -679,12 +681,17 @@ scm_lreadrecparen (SCM *tok_buf, SCM port, char *name, SCM *copy)
scm_wta (SCM_UNDEFINED, "missing close paren", "");
goto exit;
}
- tl = SCM_SETCDR (tl, scm_cons (tmp, SCM_EOL));
+
+ new_tail = scm_cons (tmp, SCM_EOL);
+ SCM_SETCDR (tl, new_tail);
+ tl = new_tail;
+
if (SCM_COPY_SOURCE_P)
- tl2 = SCM_SETCDR (tl2, scm_cons (SCM_CONSP (tmp)
- ? *copy
- : tmp,
- SCM_EOL));
+ {
+ SCM new_tail2 = scm_cons (SCM_CONSP (tmp) ? *copy : tmp, SCM_EOL);
+ SCM_SETCDR (tl2, new_tail2);
+ tl2 = new_tail2;
+ }
}
exit:
scm_whash_insert (scm_source_whash,
diff --git a/libguile/srcprop.c b/libguile/srcprop.c
index 7f2271df7..0ac089cfd 100644
--- a/libguile/srcprop.c
+++ b/libguile/srcprop.c
@@ -262,24 +262,22 @@ SCM_DEFINE (scm_set_source_property_x, "set-source-property!", 3, 0, 0,
}
if (SCM_EQ_P (scm_sym_breakpoint, key))
{
- if (SCM_FALSEP (datum))
- CLEARSRCPROPBRK (SRCPROPSP (p)
- ? p
- : SCM_WHASHSET (scm_source_whash, h,
- scm_make_srcprops (0,
- 0,
- SCM_UNDEFINED,
- SCM_UNDEFINED,
- p)));
+ if (SRCPROPSP (p))
+ {
+ if (SCM_FALSEP (datum))
+ CLEARSRCPROPBRK (p);
+ else
+ SETSRCPROPBRK (p);
+ }
else
- SETSRCPROPBRK (SRCPROPSP (p)
- ? p
- : SCM_WHASHSET (scm_source_whash, h,
- scm_make_srcprops (0,
- 0,
- SCM_UNDEFINED,
- SCM_UNDEFINED,
- p)));
+ {
+ SCM sp = scm_make_srcprops (0, 0, SCM_UNDEFINED, SCM_UNDEFINED, p);
+ SCM_WHASHSET (scm_source_whash, h, sp);
+ if (SCM_FALSEP (datum))
+ CLEARSRCPROPBRK (sp);
+ else
+ SETSRCPROPBRK (sp);
+ }
}
else if (SCM_EQ_P (scm_sym_line, key))
{