mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
* fixes a critical GC safety inference bug * make nimsuggest compile again * make Nimble compile again
22 lines
466 B
Nim
22 lines
466 B
Nim
discard """
|
|
errormsg: "'myproc' is not GC-safe as it accesses 'global_proc' which is a global using GC'ed memory"
|
|
line: 12
|
|
cmd: "nim $target --hints:on --threads:on $options $file"
|
|
"""
|
|
|
|
var useGcMem = "string here"
|
|
|
|
var global_proc: proc(a: string) {.nimcall.} = proc (a: string) =
|
|
echo useGcMem
|
|
|
|
proc myproc(i: int) {.gcsafe.} =
|
|
when false:
|
|
if global_proc != nil:
|
|
echo "a"
|
|
if isNil(global_proc):
|
|
return
|
|
|
|
global_proc("ho")
|
|
|
|
myproc(0)
|