From d2684cdfd2d7db18bf9ea3e2efcb8e80b0fc9131 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 6 Jul 2019 21:20:16 +0200 Subject: fixes #11447 --- lib/system/mmdisp.nim | 4 +++- lib/system/strmantle.nim | 2 +- tests/system/tgogc.nim | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/system/tgogc.nim diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index a56be3d23..47bb400a7 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -235,6 +235,8 @@ elif defined(gogc): proc goSetFinalizer(obj: pointer, f: pointer) {.importc: "set_finalizer", codegenDecl:"$1 $2$3 __asm__ (\"main.Set_finalizer\");\n$1 $2$3", dynlib: goLib.} proc writebarrierptr(dest: PPointer, src: pointer) {.importc: "writebarrierptr", codegenDecl:"$1 $2$3 __asm__ (\"main.Atomic_store_pointer\");\n$1 $2$3", dynlib: goLib.} + proc `$`*(x: uint64): string {.noSideEffect, raises: [].} + proc GC_getStatistics(): string = var mstats = goMemStats() result = "[GC] total allocated memory: " & $(mstats.total_alloc) & "\n" & @@ -268,7 +270,7 @@ elif defined(gogc): result = goMalloc(size.uint) proc realloc(p: pointer, newsize: Natural): pointer = - raise newException(Exception, "not implemented") + doAssert false, "not implemented" proc dealloc(p: pointer) = discard diff --git a/lib/system/strmantle.nim b/lib/system/strmantle.nim index 66477923c..a54f7a562 100644 --- a/lib/system/strmantle.nim +++ b/lib/system/strmantle.nim @@ -304,7 +304,7 @@ proc nimCharToStr(x: char): string {.compilerRtl.} = result = newString(1) result[0] = x -proc `$`*(x: uint64): string {.noSideEffect.} = +proc `$`*(x: uint64): string {.noSideEffect, raises: [].} = ## The stringify operator for an unsigned integer argument. Returns `x` ## converted to a decimal string. if x == 0: diff --git a/tests/system/tgogc.nim b/tests/system/tgogc.nim new file mode 100644 index 000000000..fd45bb120 --- /dev/null +++ b/tests/system/tgogc.nim @@ -0,0 +1,7 @@ +discard """ + disabled: "windows" + cmd: "nim c --gc:go $file" + action: "compile" +""" +# bug #11447 +echo "Go GC test" -- cgit 1.4.1-2-gfad0