From cc6c04b9e6c8519219ed3a6185b79a0699e1edbb Mon Sep 17 00:00:00 2001 From: Antonis Geralis Date: Fri, 26 Aug 2022 21:51:27 +0300 Subject: [PATCH] fixes #2 nimLeaveFinally is added automatically --- drchaos.nimble | 2 +- drchaos/mutator.nim | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drchaos.nimble b/drchaos.nimble index 2259aa8..498ea90 100644 --- a/drchaos.nimble +++ b/drchaos.nimble @@ -24,7 +24,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") = exec "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim" proc test(name: string, srcDir = "tests/", args = "", lang = "c") = - buildBinary name, srcDir, "--mm:arc -d:danger" + buildBinary name, srcDir, "-d:release" # Should ideally run inside build/ because of the artifacts, but cd doesn't work! exec "build/" & name & " -max_total_time=3 -runs=10000" & args diff --git a/drchaos/mutator.nim b/drchaos/mutator.nim index b81dbf8..e1e56ee 100644 --- a/drchaos/mutator.nim +++ b/drchaos/mutator.nim @@ -515,8 +515,9 @@ template mutatorImpl(target, mutator, typ: untyped) = try: FuzzTarget(target)(getInput(x, data)) finally: - # Call Nim's compiler api to report unhandled exceptions. - {.emit: "nimTestErrorFlag();".} + when compileOption("exceptions", "goto"): + # Call Nim's compiler api to report unhandled exceptions. + {.emit: "nimTestErrorFlag();".} proc customMutatorImpl(x: var typ; data: openArray[byte]; maxLen: int; r: var Rand): int {.nosan.} =