bugfix: GC marker procs; making tests green again
This commit is contained in:
parent
22c310485a
commit
5c33f76517
4 changed files with 10 additions and 4 deletions
|
|
@ -109,6 +109,10 @@ proc genTraverseProc(m: BModule, typ: PType, reason: TTypeInfoReason): PRope =
|
||||||
c.p = p
|
c.p = p
|
||||||
if typ.kind == tySequence:
|
if typ.kind == tySequence:
|
||||||
genTraverseProcSeq(c, "a".toRope, typ)
|
genTraverseProcSeq(c, "a".toRope, typ)
|
||||||
|
else:
|
||||||
|
if skipTypes(typ.sons[0], abstractInst).kind in {tyArrayConstr, tyArray}:
|
||||||
|
# C's arrays are broken beyond repair:
|
||||||
|
genTraverseProc(c, "a".toRope, typ.sons[0])
|
||||||
else:
|
else:
|
||||||
genTraverseProc(c, "(*a)".toRope, typ.sons[0])
|
genTraverseProc(c, "(*a)".toRope, typ.sons[0])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -866,9 +866,11 @@ proc typeAllowedAux(marker: var TIntSet, typ: PType, kind: TSymKind): bool =
|
||||||
of tyArray:
|
of tyArray:
|
||||||
result = t.sons[1].kind == tyEmpty or
|
result = t.sons[1].kind == tyEmpty or
|
||||||
typeAllowedAux(marker, t.sons[1], skVar)
|
typeAllowedAux(marker, t.sons[1], skVar)
|
||||||
of tyPtr, tyRef:
|
of tyRef:
|
||||||
if kind == skConst: return false
|
if kind == skConst: return false
|
||||||
result = typeAllowedAux(marker, t.sons[0], skVar)
|
result = typeAllowedAux(marker, t.sons[0], skVar)
|
||||||
|
of tyPtr:
|
||||||
|
result = typeAllowedAux(marker, t.sons[0], skVar)
|
||||||
of tyArrayConstr, tyTuple, tySet, tyConst, tyMutable, tyIter, tyProxy:
|
of tyArrayConstr, tyTuple, tySet, tyConst, tyMutable, tyIter, tyProxy:
|
||||||
for i in countup(0, sonsLen(t) - 1):
|
for i in countup(0, sonsLen(t) - 1):
|
||||||
result = typeAllowedAux(marker, t.sons[i], kind)
|
result = typeAllowedAux(marker, t.sons[i], kind)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
discard """
|
discard """
|
||||||
file: "t99bott.nim"
|
file: "t99bott.nim"
|
||||||
line: 26
|
line: 26
|
||||||
errormsg: "cannot evaluate 'GetBottleNumber(bn)'"
|
errormsg: "constant expression expected"
|
||||||
disabled: false
|
disabled: false
|
||||||
"""
|
"""
|
||||||
## 99 Bottles of Beer
|
## 99 Bottles of Beer
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
line: 7
|
line: 7
|
||||||
errormsg: "a type has no value"
|
errormsg: "type mismatch"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
type a = enum b,c,d
|
type a = enum b,c,d
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue