From cc8ea3f88c75216c7c03342a4a41bbc7d0b354f5 Mon Sep 17 00:00:00 2001 From: Mistivia Date: Wed, 23 Jul 2025 13:02:50 +0800 Subject: fix filename init --- Makefile | 2 +- interp.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.0