summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
authorTanguy <tanguy@status.im>2022-06-14 12:37:31 +0200
committerGitHub <noreply@github.com>2022-06-14 12:37:31 +0200
commit251bdc1d5aed98fccb31677dda3c3ead9be2f6bf (patch)
treedd02fc575bfbfabbabfdcd3c90de4dc00a9f4437 /config
parentb41226001ce596fe520fd326a302c6f4e91c2504 (diff)
downloadNim-251bdc1d5aed98fccb31677dda3c3ead9be2f6bf.tar.gz
Windows: enable nimRawSetjmp by default [backport] (#19891)
* Windows: enable nimRawSetjmp by default

See #19197. The default setjmp can randomly segfault on windows

* Attempt to disable the flag for bootstraping

* Disable styleCheck for c_setjmp
Diffstat (limited to 'config')
-rw-r--r--config/config.nims5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/config.nims b/config/config.nims
index 08d9d9f55..b50181eaf 100644
--- a/config/config.nims
+++ b/config/config.nims
@@ -20,5 +20,10 @@ when defined(nimStrictMode):
     switch("hintAsError", "ConvFromXtoItselfNotNeeded")
     # future work: XDeclaredButNotUsed
 
+when defined(windows) and not defined(booting):
+  # Avoid some rare stack corruption while using exceptions with a SEH-enabled
+  # toolchain: https://github.com/nim-lang/Nim/pull/19197
+  switch("define", "nimRawSetjmp")
+
 switch("define", "nimVersion:" & NimVersion)
 switch("define", "nimPreviewDotLikeOps")