aboutsummaryrefslogtreecommitdiff
path: root/src/interp.h
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-07-01 19:14:09 +0800
committerMistivia <i@mistivia.com>2025-07-01 19:14:09 +0800
commitaec1c5667b130d40c86403037bb16463f77db7bb (patch)
tree5b43e82fe5a4e4fe086947fcf3f793a2cebda906 /src/interp.h
parent10b2b4d98d9a96890779007e4e574bb4471f1031 (diff)
use pointer instead of handler in gc
Diffstat (limited to 'src/interp.h')
-rw-r--r--src/interp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interp.h b/src/interp.h
index 4e43cd8..515da15 100644
--- a/src/interp.h
+++ b/src/interp.h
@@ -44,7 +44,7 @@ void Interp_add_userfunc(Interp *self, const char *name, LispUserFunc fn);
SExpRef Interp_eval_string(Interp *interp, const char * str);
SExpRef Interp_load_file(Interp *interp, const char *filename);
-#define REF(_x) (&(interp->objs.buffer)[(_x).idx])
+#define REF(_x) (((_x).idx) >= 0 ? (&(interp->objs.buffer)[(_x).idx]) : NULL)
#define CONS(_x, _y) (lisp_cons(interp, (_x), (_y)))
#define NILP(_x) (lisp_nilp(interp, (_x)))
#define LENGTH(_x) (lisp_length(interp, (_x)))