Skip to content

Commit

Permalink
workaround windows SIGSEGV stdlib_winleanDatInit000
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 12, 2019
1 parent 15fdc20 commit 5f200e6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,14 @@ proc loadDynamicLib(m: BModule, lib: PLib) =
proc mangleDynLibProc(sym: PSym): Rope =
# we have to build this as a single rope in order not to trip the
# optimization in genInfixCall, see test tests/cpp/t8241.nim
if sym.loc.r != nil:
if sym.loc.r.data.len > 0:
return sym.loc.r
else:
return rope($sym.loc.r)
when not defined(windows):
# mysterious bug that only affects windows, causing SIGSEGV in
# stdlib_winleanDatInit000 () at generated_not_to_break_here
if sym.loc.r != nil:
if sym.loc.r.data.len > 0:
return sym.loc.r
else:
return rope($sym.loc.r)
if sfCompilerProc in sym.flags:
# NOTE: sym.loc.r is the external name!
result = rope(sym.name.s)
Expand Down

0 comments on commit 5f200e6

Please sign in to comment.