Skip to content

Commit

Permalink
Merge pull request #366 from visitorckw/ci-add-undefined-behaviour-test
Browse files Browse the repository at this point in the history
CI: Add undefined behavior test
  • Loading branch information
jserv authored Feb 29, 2024
2 parents 10fba76 + 17db3b2 commit 9e4e13e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ jobs:
make ENABLE_EXT_A=0 ENABLE_JIT=1 clean check
make ENABLE_EXT_F=0 ENABLE_JIT=1 clean check
make ENABLE_EXT_C=0 ENABLE_JIT=1 clean check
- name: undefined behavior test
run: |
make ENABLE_UBSAN=1 clean check
make ENABLE_JIT=1 ENABLE_UBSAN=1 clean check
host-arm64:
needs: [detect-code-related-file-changes]
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ ifeq ("$(CC_IS_EMCC)", "1")
CFLAGS += -mtail-call
endif

ENABLE_UBSAN ?= 0
ifeq ("$(ENABLE_UBSAN)", "1")
CFLAGS += -fsanitize=undefined -fno-sanitize=alignment -fno-sanitize-recover=all
LDFLAGS += -fsanitize=undefined -fno-sanitize=alignment -fno-sanitize-recover=all
endif

$(OUT)/emulate.o: CFLAGS += -foptimize-sibling-calls -fomit-frame-pointer -fno-stack-check -fno-stack-protector

# Clear the .DEFAULT_GOAL special variable, so that the following turns
Expand Down

0 comments on commit 9e4e13e

Please sign in to comment.