klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit a7b3abe577e200a092cf3d7b928b424a8c13acfe
parent 4630eb4a52d62f77e5355203443ac9543b2f9643
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Fri, 29 Apr 2011 15:42:00 -0300

Bugfix: Both symbols & strings were initializing the header fields by hand and weren't initializing the new si field. (thanks again Valgrind).

Diffstat:
Msrc/kgc.c | 1+
Msrc/kstring.c | 1+
Msrc/ksymbol.c | 1+
3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/kgc.c b/src/kgc.c @@ -762,6 +762,7 @@ void klispC_barrierback (klisp_State *K, Table *t) { } /* NOTE: kflags is added for klisp */ +/* NOTE: both symbols & strings do this "by hand", they don't call this */ void klispC_link (klisp_State *K, GCObject *o, uint8_t tt, uint8_t kflags) { o->gch.next = K->rootgc; K->rootgc = o; diff --git a/src/kstring.c b/src/kstring.c @@ -112,6 +112,7 @@ TValue kstring_new_bs_imm(klisp_State *K, const char *buf, uint32_t size) new_str->gct = klispC_white(K); new_str->tt = K_TSTRING; new_str->kflags = K_FLAG_IMMUTABLE; + new_str->si = NULL; /* string specific fields */ new_str->hash = h; new_str->mark = KFALSE; diff --git a/src/ksymbol.c b/src/ksymbol.c @@ -61,6 +61,7 @@ TValue ksymbol_new_g(klisp_State *K, const char *buf, int32_t size, new_sym->gct = klispC_white(K); new_sym->tt = K_TSYMBOL; new_sym->kflags = identifierp? K_FLAG_EXT_REP : 0; + new_sym->si = NULL; /* symbol specific fields */ new_sym->mark = KFALSE;