klisp

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

commit 16a7dd113090e31f05d019b9372cc9bb0bfb691a
parent a14163fbe8cd5c129444b53862a09c8754332ae5
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Fri, 24 Aug 2012 03:45:58 -0300

Bugfix: added lock around aux stack use in keyed environment lookup.

Diffstat:
Msrc/kenvironment.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/kenvironment.c b/src/kenvironment.c @@ -290,7 +290,8 @@ static inline bool try_get_keyed(klisp_State *K, TValue env, TValue key, /* MAYBE: this could be optimized to mark environments to avoid repetition */ /* assume the stack may be in use, keep track of pushed objs */ - /* LOCK: the key info structure is immutable, so no need to lock */ + + klisp_lock(K); int pushed = 1; if (!env_is_keyed(env)) env = env_keyed_parents(env); @@ -319,6 +320,7 @@ static inline bool try_get_keyed(klisp_State *K, TValue env, TValue key, pushed += 2; } } + klisp_unlock(K); *value = KINERT; return false; }