From da2306f5bcd77b9ec70ffd8b4df2c361d639b59d Mon Sep 17 00:00:00 2001 From: "Ian A. Mason" Date: Sun, 13 May 2018 07:42:20 -0700 Subject: [PATCH] Added the compile and link flag '-fsanitize=' to solve issue #19 --- examples/issue19/Makefile | 20 ++++++++++++++++++++ examples/issue19/test.c | 4 ++++ shared/parser.go | 1 + 3 files changed, 25 insertions(+) create mode 100644 examples/issue19/Makefile create mode 100644 examples/issue19/test.c diff --git a/examples/issue19/Makefile b/examples/issue19/Makefile new file mode 100644 index 0000000..c546a33 --- /dev/null +++ b/examples/issue19/Makefile @@ -0,0 +1,20 @@ + + + + +one: + ${CC} test.c -fsanitize=address -o test + + +test.o: + ${CC} -c test.c -fsanitize=address + + +test: test.o + ${CC} test.o -fsanitize=address -o test + + + +clean: + rm -f test.o test .test* *~ + diff --git a/examples/issue19/test.c b/examples/issue19/test.c new file mode 100644 index 0000000..2278f5a --- /dev/null +++ b/examples/issue19/test.c @@ -0,0 +1,4 @@ +#include +int main(void) { + printf("test\n"); +} diff --git a/shared/parser.go b/shared/parser.go index d76f9f6..2ba5138 100644 --- a/shared/parser.go +++ b/shared/parser.go @@ -263,6 +263,7 @@ func parse(argList []string) parserResult { `^-U.+$`: {0, pr.compileUnaryCallback}, `^-Wl,.+$`: {0, pr.linkUnaryCallback}, `^-W[^l].*$`: {0, pr.compileUnaryCallback}, + `^-fsanitize=.+$`: {0, pr.compileLinkUnaryCallback}, `^-f.+$`: {0, pr.compileUnaryCallback}, `^-rtlib=.+$`: {0, pr.linkUnaryCallback}, `^-std=.+$`: {0, pr.compileUnaryCallback},