klisp

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

commit d14d0e6aa65b3ab23a3da953301764c8e0742831
parent 753b240d6fb63fc3e6774dfd652af58b3944dd9d
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Thu,  3 Mar 2011 01:45:48 -0300

Bugfix in kenvironment error throwing (was trying to concat to a literal string)

Diffstat:
Msrc/kenvironment.c | 3++-
Msrc/kerror.c | 8++++++++
Msrc/kerror.h | 3+++
3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/kenvironment.c b/src/kenvironment.c @@ -76,7 +76,8 @@ TValue kget_binding(klisp_State *K, TValue env, TValue sym) return kcdr(oldb); env = kenv_parents(K, env); } - klispE_throw(K, strcat("Unbound symbol: ", ksymbol_buf(sym)), true); + + klispE_throw_extra(K, "Unbound symbol ", ksymbol_buf(sym), true); /* avoid warning */ return KINERT; } diff --git a/src/kerror.c b/src/kerror.c @@ -13,3 +13,11 @@ void klispE_throw(klisp_State *K, char *msg, bool can_cont) K->error_can_cont = can_cont; longjmp(K->error_jb, 1); } + +/* TEMP: for throwing with extra msg info */ +void klispE_throw_extra(klisp_State *K, char *msg, char *extra_msg, + bool can_cont) { + fprintf(stderr, "\n*ERROR*: %s %s\n", msg, extra_msg); + K->error_can_cont = can_cont; + longjmp(K->error_jb, 1); +} diff --git a/src/kerror.h b/src/kerror.h @@ -14,5 +14,8 @@ #include "kstate.h" void klispE_throw(klisp_State *K, char *msg, bool can_cont); +/* TEMP: for throwing with extra msg info */ +void klispE_throw_extra(klisp_State *K, char *msg, char *extra_msg, + bool can_cont); #endif