aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-07-23 13:02:50 +0800
committerMistivia <i@mistivia.com>2025-07-23 13:02:50 +0800
commitcc8ea3f88c75216c7c03342a4a41bbc7d0b354f5 (patch)
treee508d96435bb5088dd679d61fc75032f326ccaca
parentfe6adec77e7f8697d4bc451bbbf7d60cefb45205 (diff)
fix filename init
-rw-r--r--Makefile2
-rw-r--r--interp.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dc1eff6..77a9aae 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ ifeq ($(mode), debug)
-g \
-fsanitize=address
else
- cflags = $(includes) -O2
+ cflags = $(includes) -g -O2
endif
src = $(shell find ./ -maxdepth 1 -name '*.c' -not -name 'main.c')
diff --git a/interp.c b/interp.c
index 0af16de..dbc790f 100644
--- a/interp.c
+++ b/interp.c
@@ -93,6 +93,9 @@ void Interp_init(Interp *self) {
SExpVector_push_back(&self->objs, sexp);
self->nil = (SExpRef){i}; i++;
+ self->filename.idx = 0;
+ self->linenum = 1;
+
sexp.type = kEnvSExp;
sexp.env.parent= self->nil;
sexp.env.bindings = self->nil;