klisp

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

commit 962d81818dcaf760b5ed8017f75cda500570ba70
parent a41bd15d66f8068bc7cb2b6c0599c4d5bf166c20
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Thu, 20 Mar 2014 13:12:04 -0300

Issue 9 Bugfix.  Moved NULL check in main klisp_State object upwards.  Thanks J. Armstrong.

Diffstat:
Msrc/klisp.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/klisp.c b/src/klisp.c @@ -711,15 +711,16 @@ int main(int argc, char *argv[]) { struct Smain s; klisp_State *K = klispL_newstate(); - /* Set the main thread as the current thread */ - /* XXX/TEMP this could be made in run... */ - K->thread = pthread_self(); if (K == NULL) { k_message(argv[0], "cannot create state: not enough memory"); return EXIT_FAILURE; } + /* Set the main thread as the current thread */ + /* XXX/TEMP this could be made in run... */ + K->thread = pthread_self(); + /* This is weird but was done to follow lua scheme */ s.argc = argc; s.argv = argv;