summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-01-29 01:53:09 +0100
committerAraq <rumpf_a@web.de>2012-01-29 01:53:09 +0100
commit9083f01fd23fe7ea3470136ec2cd7a0d2a600b43 (patch)
tree5d1f5dad3fcc17bbde86a9125e1c10fff319db2e /lib
parent2dd0f8eeabcc4c5415efff6ed33c8a2b144a2c48 (diff)
downloadNim-9083f01fd23fe7ea3470136ec2cd7a0d2a600b43.tar.gz
fixed #96 as good as technically possible (debug frames are allocated on the C stack)
Diffstat (limited to 'lib')
-rwxr-xr-xlib/pure/algorithm.nim4
-rwxr-xr-xlib/system.nim8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index 15b0129ad..1e9a0bb4b 100755
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -35,12 +35,12 @@ proc reverse*[T](a: var openArray[T]) =
   reverse(a, 0, a.high)
 
 const
-  onlySafeCode = true
+  onlySafeCode = false
 
 proc merge[T](a, b: var openArray[T], lo, m, hi: int, 
               cmp: proc (x, y: T): int, order: TSortOrder) =
   template `<-` (a, b: expr) = 
-    when true:
+    when false:
       a = b
     elif onlySafeCode:
       shallowCopy(a, b)
diff --git a/lib/system.nim b/lib/system.nim
index d9d3ebd86..11188a4c0 100755
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2129,16 +2129,16 @@ template assert*(cond: expr, msg = "") =
   ## Use ``assert`` for debugging purposes only.
   bind raiseAssert, InstantiationInfo
   when compileOption("assertions"):
-    if not cond:
-      {.line.}:
+    {.line.}:
+      if not cond:
         raiseAssert(astToStr(cond) & ' ' & msg)
 
 template doAssert*(cond: expr, msg = "") =
   ## same as `assert` but is always turned on and not affected by the
   ## ``--assertions`` command line switch.
   bind raiseAssert, InstantiationInfo
-  if not cond:
-    {.line: InstantiationInfo().}:
+  {.line: InstantiationInfo().}:
+    if not cond:
       raiseAssert(astToStr(cond) & ' ' & msg)