Skip to content

Commit 44e3920

Browse files
committed
workaround windows SIGSEGV stdlib_winleanDatInit000
1 parent fc5d885 commit 44e3920

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

compiler/cgen.nim

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,14 @@ proc loadDynamicLib(m: BModule, lib: PLib) =
697697
proc mangleDynLibProc(sym: PSym): Rope =
698698
# we have to build this as a single rope in order not to trip the
699699
# optimization in genInfixCall, see test tests/cpp/t8241.nim
700-
if sym.loc.r != nil:
701-
if sym.loc.r.data.len > 0:
702-
return sym.loc.r
703-
else:
704-
return rope($sym.loc.r)
700+
when not defined(windows):
701+
# mysterious bug that only affects windows, causing SIGSEGV in
702+
# stdlib_winleanDatInit000 () at generated_not_to_break_here
703+
if sym.loc.r != nil:
704+
if sym.loc.r.data.len > 0:
705+
return sym.loc.r
706+
else:
707+
return rope($sym.loc.r)
705708
if sfCompilerProc in sym.flags:
706709
# NOTE: sym.loc.r is the external name!
707710
result = rope(sym.name.s)

0 commit comments

Comments
 (0)