From 46edebcbc522e112c5d05cfa049e4fea305e2295 Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 4 Sep 2023 11:40:15 +0000 Subject: [PATCH] run UBSAN in Linux in unit tests --- .github/workflows/ci.yml | 2 -- snappy.nimble | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1cc2b2..9b5db9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,6 @@ jobs: cpu: amd64 - os: windows cpu: amd64 - #- os: windows - #cpu: i386 branch: [version-1-6, version-2-0, devel] include: - target: diff --git a/snappy.nimble b/snappy.nimble index ad8b781..f3a40bf 100644 --- a/snappy.nimble +++ b/snappy.nimble @@ -17,9 +17,14 @@ let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js) let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler let verbose = getEnv("V", "") notin ["", "0"] +const sanitize = "\"-fsanitize=undefined\"" + let cfg = " --styleCheck:usages --styleCheck:error" & (if verbose: "" else: " --verbosity:0 --hints:off") & + (if defined(linux): + " --passC:" & sanitize & " --passL: " & sanitize + else: "") & " --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" proc build(args, path: string) =