summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-11-17 17:15:54 +0800
committerGitHub <noreply@github.com>2021-11-17 10:15:54 +0100
commitfe46c8b5f13f854e4109183d2199b922f939548c (patch)
tree39aeadcaf8a81537f795caedce9991ceabe0ab9a /compiler
parent92d6fb86c66ceda154972314ba695cea4aac9301 (diff)
downloadNim-fe46c8b5f13f854e4109183d2199b922f939548c.tar.gz
fix marshal bugs in VM (#19161) [backport:1.6]
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmmarshal.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/vmmarshal.nim b/compiler/vmmarshal.nim
index d48d2408c..d28f0325b 100644
--- a/compiler/vmmarshal.nim
+++ b/compiler/vmmarshal.nim
@@ -92,7 +92,8 @@ proc storeAny(s: var string; t: PType; a: PNode; stored: var IntSet;
       if a[i].kind == nkRange:
         var x = copyNode(a[i][0])
         storeAny(s, t.lastSon, x, stored, conf)
-        while x.intVal+1 <= a[i][1].intVal:
+        inc x.intVal
+        while x.intVal <= a[i][1].intVal:
           s.add(", ")
           storeAny(s, t.lastSon, x, stored, conf)
           inc x.intVal
@@ -231,7 +232,6 @@ proc loadAny(p: var JsonParser, t: PType,
     result = newNode(nkCurly)
     while p.kind != jsonArrayEnd and p.kind != jsonEof:
       result.add loadAny(p, t.lastSon, tab, cache, conf, idgen)
-      next(p)
     if p.kind == jsonArrayEnd: next(p)
     else: raiseParseErr(p, "']' end of array expected")
   of tyPtr, tyRef: