summary refs log tree commit diff stats
path: root/lib/system/excpt.nim
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2021-02-17 10:30:09 -0800
committerGitHub <noreply@github.com>2021-02-17 19:30:09 +0100
commit31bb67a309ae4bfdc1909c0a7c6748a534a0b00e (patch)
tree8169cc14488a083ffb2d1e8373042bdc0c0c0e73 /lib/system/excpt.nim
parent35e14998ec97deb4efdbec9390b607c876a7a17f (diff)
downloadNim-31bb67a309ae4bfdc1909c0a7c6748a534a0b00e.tar.gz
add -d:nimStrictMode in CI to keep code from regressing; fixes ConvFromXtoItselfNotNeeded, UnusedImport notes (#16764)
Diffstat (limited to 'lib/system/excpt.nim')
-rw-r--r--lib/system/excpt.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index 95dbfe3af..dbb39f536 100644
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -378,7 +378,8 @@ proc reportUnhandledErrorAux(e: ref Exception) {.nodestroy.} =
     # ugly, but avoids heap allocations :-)
     template xadd(buf, s, slen) =
       if L + slen < high(buf):
-        copyMem(addr(buf[L]), cstring(s), slen)
+
+        copyMem(addr(buf[L]), (when s is cstring: s else: cstring(s)), slen)
         inc L, slen
     template add(buf, s) =
       xadd(buf, s, s.len)