fix marshal bugs in VM (#19161) [backport:1.6]
This commit is contained in:
parent
92d6fb86c6
commit
fe46c8b5f1
2 changed files with 10 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,11 @@ discard """
|
|||
|
||||
import marshal
|
||||
|
||||
let orig: set[char] = {'A'..'Z'}
|
||||
let m = $$orig
|
||||
let old = to[set[char]](m)
|
||||
doAssert orig - old == {}
|
||||
template main() =
|
||||
let orig: set[char] = {'A'..'Z'}
|
||||
let m = $$orig
|
||||
let old = to[set[char]](m)
|
||||
doAssert orig - old == {}
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue