summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-01 09:25:42 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-01 09:25:42 -0800
commit08cebd08c7645737d44de8a801af7c2df7874571 (patch)
tree78969e3fda526f41a4b846652fccd30b53e14b48
parent04ed380c4a389c0c21eae8e3cd35e7e44506a2e3 (diff)
downloadtxr-08cebd08c7645737d44de8a801af7c2df7874571.tar.gz
txr-08cebd08c7645737d44de8a801af7c2df7874571.tar.bz2
txr-08cebd08c7645737d44de8a801af7c2df7874571.zip
Bug ID 27895: Calls to protect have an argument list terminated
by the integer constant 0 rather than a proper null pointer constant.
-rw-r--r--ChangeLog13
-rw-r--r--lib.c3
-rw-r--r--stream.c2
-rw-r--r--txr.c4
-rw-r--r--unwind.c2
5 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 7836e807..230e9e31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2009-11-01 Kaz Kylheku <kkylheku@gmail.com>
+ Bug ID 27895: Calls to protect have an argument list terminated
+ by the integer constant 0 rather than a proper null pointer constant.
+
+ lib.c (obj_init): Properly terminate argument list of protect call.
+
+ stream.c (stream_init): Likewise.
+
+ unwind.c (unwind_init): Likewise.
+
+ txr.c (txr_main): two-argument protect calls rewritten using prot1.
+
+2009-11-01 Kaz Kylheku <kkylheku@gmail.com>
+
Bug ID 27899: Garbage collection problem: method of locating stack
bottom is unreliable due to the unpredictable allocation order of local
variables. The addresses of stack_bottom_0 and stack_bottom_1 variables
diff --git a/lib.c b/lib.c
index 5694b9a1..aa17a7a5 100644
--- a/lib.c
+++ b/lib.c
@@ -1681,7 +1681,8 @@ static void obj_init(void)
&two, &negone, &maxint, &minint,
&null_string, &nil_string,
&null_list, &equal_f,
- &identity_f, &prog_string, 0);
+ &identity_f, &prog_string,
+ (obj_t **) 0);
nil_string = string("nil");
diff --git a/stream.c b/stream.c
index 6379649e..01ef8ad0 100644
--- a/stream.c
+++ b/stream.c
@@ -634,7 +634,7 @@ obj_t *put_line(obj_t *stream, obj_t *string)
void stream_init(void)
{
- protect(&std_input, &std_output, &std_error, 0);
+ protect(&std_input, &std_output, &std_error, (obj_t **) 0);
std_input = make_stdio_stream(stdin, t, nil);
std_output = make_stdio_stream(stdout, nil, t);
std_error = make_stdio_stream(stderr, nil, t);
diff --git a/txr.c b/txr.c
index d369816f..281820e3 100644
--- a/txr.c
+++ b/txr.c
@@ -151,10 +151,10 @@ static int txr_main(int argc, char **argv)
int match_loglevel = opt_loglevel;
progname = argv[0] ? argv[0] : progname;
- protect(&spec_file_str, 0);
+ prot1(&spec_file_str);
yyin_stream = std_input;
- protect(&yyin_stream, 0);
+ prot1(&yyin_stream);
if (argc <= 1) {
hint();
diff --git a/unwind.c b/unwind.c
index 1a8cb987..8c817da5 100644
--- a/unwind.c
+++ b/unwind.c
@@ -361,7 +361,7 @@ void uw_continue(uw_frame_t *current, uw_frame_t *cont)
void uw_init(void)
{
- protect(&toplevel_env.ev.func_bindings, &exception_subtypes, 0);
+ protect(&toplevel_env.ev.func_bindings, &exception_subtypes, (obj_t **) 0);
exception_subtypes = cons(cons(t, nil), exception_subtypes);
uw_register_subtype(type_error, error);
uw_register_subtype(internal_err, error);