summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-18 10:51:15 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-11-18 10:51:15 -0800
commit6d2bc0b88c6f0060bce5c79ee5879cf4ce77a35f (patch)
treee99dd6f7fec514671f6815db79971eec0641b059 /lib.c
parentf55237951cd029bdfe40346c52060a8ed59bb49e (diff)
downloadtxr-6d2bc0b88c6f0060bce5c79ee5879cf4ce77a35f.tar.gz
txr-6d2bc0b88c6f0060bce5c79ee5879cf4ce77a35f.tar.bz2
txr-6d2bc0b88c6f0060bce5c79ee5879cf4ce77a35f.zip
Added a JSON parsing test case. This flushed out a bug which crashed
the garbage collector (uninitialized fields in function objects). * Makefile: Defined TXR_ARGS and TXR_OPTS for new test case. * hash.c (hash_begin): Construction of cobj modified to obey the correct procedure described in HACKING. * lib.c (func_n3, func_n4): These functions neglected to initialize the env member of the function structure. * tests/009/json.expected: New file. * tests/009/json.txr: New file. * tests/009/webapp.json: New file.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 7d5a8e46..41bf5e8f 100644
--- a/lib.c
+++ b/lib.c
@@ -1442,6 +1442,7 @@ val func_n3(val (*fun)(val, val, val))
val obj = make_obj();
obj->f.type = FUN;
obj->f.functype = N3;
+ obj->f.env = nil;
obj->f.f.n3 = fun;
return obj;
}
@@ -1451,6 +1452,7 @@ val func_n4(val (*fun)(val, val, val, val))
val obj = make_obj();
obj->f.type = FUN;
obj->f.functype = N4;
+ obj->f.env = nil;
obj->f.f.n4 = fun;
return obj;
}