summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorRuslan Mustakov <endragor@users.noreply.github.com>2017-03-22 07:06:05 +0700
committerAndreas Rumpf <rumpf_a@web.de>2017-03-22 01:06:05 +0100
commit310b73b556957228c805df321d7a8c03d9bd2061 (patch)
tree2224459333f79ad42d15295279d52f969e7b4b0b /lib
parentc8954b2b34becebb09a3c69181094fb42f696bec (diff)
downloadNim-310b73b556957228c805df321d7a8c03d9bd2061.tar.gz
Reduce the scope of stackTrace var (#5583)
Fixes #5571.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/unittest.nim3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim
index 563968960..1ea7b8545 100644
--- a/lib/pure/unittest.nim
+++ b/lib/pure/unittest.nim
@@ -375,7 +375,6 @@ template test*(name, body) {.dirty.} =
   ensureFormattersInitialized()
 
   if shouldRun(name):
-    var stackTrace {.inject.}: string
     checkpoints = @[]
     var testStatusIMPL {.inject.} = OK
 
@@ -391,7 +390,7 @@ template test*(name, body) {.dirty.} =
     except:
       when not defined(js):
         checkpoint("Unhandled exception: " & getCurrentExceptionMsg())
-        stackTrace = getCurrentException().getStackTrace()
+        var stackTrace {.inject.} = getCurrentException().getStackTrace()
       fail()
 
     finally: