summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-07-06 21:20:16 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-07-06 21:20:16 +0200
commitd2684cdfd2d7db18bf9ea3e2efcb8e80b0fc9131 (patch)
treeec69ac7e61b42dc31f7ec49892b5b95dff7ae07d
parentcab0c3e544bb65bdd9b0f2d0e60dce55ac0776ad (diff)
downloadNim-d2684cdfd2d7db18bf9ea3e2efcb8e80b0fc9131.tar.gz
fixes #11447
-rw-r--r--lib/system/mmdisp.nim4
-rw-r--r--lib/system/strmantle.nim2
-rw-r--r--tests/system/tgogc.nim7
3 files changed, 11 insertions, 2 deletions
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"