summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-08-20 15:36:26 +0200
committerAraq <rumpf_a@web.de>2011-08-20 15:36:26 +0200
commit82af6387d9ab74675fb9ef70f36aa2a914a89191 (patch)
treef52be21dac370bc0e014cdb2c88767ad4a23459a
parentdd190a5c01ed904d844584074f729ee9cd677a3e (diff)
downloadNim-82af6387d9ab74675fb9ef70f36aa2a914a89191.tar.gz
bugfix: fixed built-in 'reset'
-rwxr-xr-xdoc/nimrodc.txt6
-rwxr-xr-xlib/system/assign.nim4
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt
index 286bf2a3f..d249d4860 100755
--- a/doc/nimrodc.txt
+++ b/doc/nimrodc.txt
@@ -315,7 +315,8 @@ ENDB. See the documentation of `endb <endb.html>`_ for further information.
 Volatile pragma

 ---------------

 The `volatile`:idx: pragma is for variables only. It declares the variable as

-``volatile``, whatever that means in C/C++.

+``volatile``, whatever that means in C/C++ (its semantics are not well defined
+in C/C++).

 

 **Note**: This pragma will not exist for the LLVM backend.

 

@@ -330,7 +331,8 @@ input management. To start Nimrod in interactive mode use the command
 ``nimrod i``. To quit use the ``quit()`` command. To determine whether an input

 line is an incomplete statement to be continued these rules are used:

 

-1. The line ends with ``[-+*/\\<>!\?\|%&$@~,;:=#^]\s*$``.

+1. The line ends with ``[-+*/\\<>!\?\|%&$@~,;:=#^]\s*$`` (operator symbol 
+   followed by optional whitespace).

 2. The line starts with a space (indentation).

 3. The line is within a triple quoted string literal. However, the detection 

    does not work if the line contains more than one ``"""``.

diff --git a/lib/system/assign.nim b/lib/system/assign.nim
index 33bfa15f3..464dfb36c 100755
--- a/lib/system/assign.nim
+++ b/lib/system/assign.nim
@@ -139,10 +139,10 @@ proc genericResetAux(dest: Pointer, n: ptr TNimNode) =
   of nkList:
     for i in 0..n.len-1: genericResetAux(dest, n.sons[i])
   of nkCase:
-    zeroMem(cast[pointer](d +% n.offset), n.typ.size)
     var m = selectBranch(dest, n)
     if m != nil: genericResetAux(dest, m)
-
+    zeroMem(cast[pointer](d +% n.offset), n.typ.size)
+  
 proc genericReset(dest: Pointer, mt: PNimType) =
   var d = cast[TAddress](dest)
   sysAssert(mt != nil)