Compare commits

..

No commits in common. "942dd444cc0346817a9471727d896964da1f98a6" and "df948b18c6158473ec3d4fb6bec56828e0a704af" have entirely different histories.

3 changed files with 5 additions and 16 deletions

View File

@ -1,4 +1,4 @@
.PHONY: all clean clean-objects clean-reports run sanitize validate fuzz .PHONY: all clean clean-objects run sanitize validate
CC=clang CC=clang
LD=clang LD=clang
@ -9,8 +9,8 @@ SOURCES = $(shell find src/ -type f -name '*.c')
OBJECTS = $(SOURCES:.c=.o) OBJECTS = $(SOURCES:.c=.o)
DEPENDENCIES = $(SOURCES:.c=.d) DEPENDENCIES = $(SOURCES:.c=.d)
TARGET?=oas TARGET?=oas
OUTPUTS=oas oas-asan oas-msan oas-afl OUTPUTS=oas oas-asan oas-msan
RUNARGUMENTS?=-tokens tests/input/valid.asm RUNARGUMENTS=-tokens test.asm
all: $(TARGET) all: $(TARGET)
@ -18,12 +18,6 @@ all: $(TARGET)
run: $(TARGET) run: $(TARGET)
./$(TARGET) $(RUNARGUMENTS) ./$(TARGET) $(RUNARGUMENTS)
fuzz:
make CC="afl-clang-fast" LD="afl-clang-fast" TARGET="oas-afl" clean-objects all
make clean-objects
mkdir -p reports/afl
afl-fuzz -i tests/input -o reports/afl -m none -- ./oas-afl -tokens @@
sanitize: sanitize:
make CFLAGS="$(CFLAGS) -fsanitize=address,undefined" LDFLAGS="-fsanitize=address,undefined" TARGET="oas-asan" clean-objects all make CFLAGS="$(CFLAGS) -fsanitize=address,undefined" LDFLAGS="-fsanitize=address,undefined" TARGET="oas-asan" clean-objects all
make CFLAGS="$(CFLAGS) -fsanitize=memory -fsanitize-memory-track-origins=2" LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2" TARGET="oas-msan" clean-objects all make CFLAGS="$(CFLAGS) -fsanitize=memory -fsanitize-memory-track-origins=2" LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2" TARGET="oas-msan" clean-objects all
@ -43,8 +37,6 @@ $(TARGET): $(OBJECTS)
clean-objects: clean-objects:
rm -f $(OBJECTS) $(DEPENDENCIES) rm -f $(OBJECTS) $(DEPENDENCIES)
clean-reports:
rm -rf reports/
clean: clean-objects clean: clean-objects
rm -f $(TARGET) $(OUTPUTS) rm -f $(TARGET) $(OUTPUTS)
rm -rf reports/

View File

@ -310,7 +310,6 @@ error_t *lexer_next_newline(lexer_t *lex, lexer_token_t *token) {
lex->character_number = 0; lex->character_number = 0;
lex->line_number += 1; lex->line_number += 1;
} else { } else {
lexer_shift_buffer(lex, 1);
token->id = TOKEN_ERROR; token->id = TOKEN_ERROR;
lex->character_number += 1; lex->character_number += 1;
token->value = strdup((char[]){lex->buffer[0]}); token->value = strdup((char[]){lex->buffer[0]});

View File

@ -3,9 +3,7 @@
set -euo pipefail set -euo pipefail
# Start with static analysis # Start with static analysis
make clean all scan-build -o reports/ -plist-html --status-bugs make clean all
mkdir -p reports/static-analysis
scan-build -o reports/static-analysis/ -plist-html --status-bugs make all
# Run the sanitizer builds and valgrind # Run the sanitizer builds and valgrind
make clean sanitize all make clean sanitize all