diff options
| author | Autumn | 2026-08-23 18:31:17 +0100 |
|---|---|---|
| committer | Autumn | 2026-08-23 18:31:17 +0100 |
| commit | fd87bbf7f74afaa5f60e5bb783e341bef91f3b87 (patch) | |
| tree | c6d4d0a65515544f8ecef8f3f9d6f3ca85ab8362 | |
| parent | a4bb8fb6a067dfc3f7126d535ccf320be80e81a8 (diff) | |
[build] added debug sanitization support
| -rw-r--r-- | Makefile | 11 | ||||
| -rw-r--r-- | todo/open.ha | 1 |
2 files changed, 10 insertions, 2 deletions
@@ -1,9 +1,16 @@ EXE := bunnytask HARE := hare PREFIX := /usr/local +HAREFLAGS := +LDFLAGS := + +ifdef DEBUG + HAREFLAGS += -lc + LDFLAGS += -fsanitize=address +endif $(EXE): - $(HARE) build -o $@ + LDFLAGS=$(LDFLAGS) $(HARE) build $(HAREFLAGS) -o $@ install: $(EXE) mkdir -p $(PREFIX)/bin/ @@ -16,6 +23,6 @@ clean: $(RM) $(EXE) check: - $(HARE) test + LDFLAGS=$(LDFLAGS) $(HARE) test $(HAREFLAGS) .PHONY: check clean install uninstall diff --git a/todo/open.ha b/todo/open.ha index 7692635..092ea24 100644 --- a/todo/open.ha +++ b/todo/open.ha @@ -16,6 +16,7 @@ export fn open(file: str) ([]str | fs::error) = { // read const todos = strings::fromutf8(todos)!; const todos = strings::split(todos, "\n")!; + defer free(todos); lib::slice_remove_empty(&todos); |
