diff --git a/makefile b/makefile
index 1058471..13c10d3 100644
--- a/makefile
+++ b/makefile
@@ -6,8 +6,8 @@
# make uninstall
## C compiler
-CC=tcc # much faster compilation than gcc
-COMPILER_FLAGS=#-g3 -Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion -fsanitize=undefined
+CC=gcc # much faster compilation than gcc
+COMPILER_FLAGS=#-Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion -fsanitize=undefined # -g3
# exclude: -fsanitize-trap, because I'm using an old version of gcc and couldn't bother getting a new one.
## ^ from
##
@@ -35,8 +35,12 @@ STYLE_BLUEPRINT=webkit
FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT)
build: $(SRC)
- $(CC) $(COMPILER_FLAGS) $(INCS) $(SRC) $(MPC) -o mumble $(LIBS)
+ $(CC) $(COMPILER_FLAGS) $(INCS) $(SRC) $(MPC) -o mumble $(LIBS) $(DEBUG)
format: $(SRC)
$(FORMATTER) $(SRC)
+debug:
+ gcc -I/usr/include/editline ./src/mumble.c ./src/mpc/mpc.c -o mumble -lm -ledit -g
+ # valgrind --tool=memcheck --leak-check=yes --show-leak-kinds=all ./mumble
+ valgrind --tool=memcheck --leak-check=yes ./mumble
diff --git a/mumble b/mumble
index 9a6a7d7..4d0d09b 100755
Binary files a/mumble and b/mumble differ
diff --git a/src/mumble.c b/src/mumble.c
index 0ad914f..89c5008 100644
--- a/src/mumble.c
+++ b/src/mumble.c
@@ -815,6 +815,7 @@ lispval* evaluate_lispval(lispval* l, lispenv* env)
// builtin_functions(operation->sym, l, env);
delete_lispval(f);
delete_lispval(operands);
+ // delete_lispval(temp);
if(VERBOSE) printfln("Returning");
return answer;
}
@@ -921,10 +922,12 @@ int main(int argc, char** argv)
delete_lispval(l);
// if(VERBOSE) printfln("Deleted that ^ lispval");
// ^ I do not understand how the memory in l is freed.
+ // delete the ast
+ mpc_ast_delete(ast);
} else {
/* Otherwise Print the Error */
mpc_err_print(result.error);
- // mpc_err_delete(result.error);
+ mpc_err_delete(result.error);
}
add_history(input);
// can't add if input is NULL