fixes a critical GC safety inference bug (#10615)

* fixes a critical GC safety inference bug
* make nimsuggest compile again
* make Nimble compile again
This commit is contained in:
Andreas Rumpf 2019-03-05 19:54:44 +01:00 • committed by GitHub
commit c86b1fbcac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 65 additions and 34 deletions

View file

@ -324,14 +324,15 @@ proc log*(s: string) {.procvar.} =
f.writeLine(s)
close(f)
proc quit(conf: ConfigRef; msg: TMsgKind) =
proc quit(conf: ConfigRef; msg: TMsgKind) {.gcsafe.} =
if defined(debug) or msg == errInternal or hintStackTrace in conf.notes:
if stackTraceAvailable() and isNil(conf.writelnHook):
writeStackTrace()
else:
styledMsgWriteln(fgRed, "No stack traceback available\n" &
"To create a stacktrace, rerun compilation with ./koch temp " &
conf.command & " <file>")
{.gcsafe.}:
if stackTraceAvailable() and isNil(conf.writelnHook):
writeStackTrace()
else:
styledMsgWriteln(fgRed, "No stack traceback available\n" &
"To create a stacktrace, rerun compilation with ./koch temp " &
conf.command & " <file>")
quit 1
proc handleError(conf: ConfigRef; msg: TMsgKind, eh: TErrorHandling, s: string) =