parent
6f3476d39c
commit
41555ca86f
3 changed files with 15 additions and 3 deletions
|
|
@ -846,7 +846,6 @@ proc isEmptyContainer(g: ModuleGraph, t: PType): bool =
|
||||||
(t.kind == tyArray and lengthOrd(g.config, t[0]) == 0) or
|
(t.kind == tyArray and lengthOrd(g.config, t[0]) == 0) or
|
||||||
(t.kind == tySequence and t[0].kind == tyError)
|
(t.kind == tySequence and t[0].kind == tyError)
|
||||||
|
|
||||||
|
|
||||||
proc createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType; info: TLineInfo) =
|
proc createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType; info: TLineInfo) =
|
||||||
## In the semantic pass this is called in strategic places
|
## In the semantic pass this is called in strategic places
|
||||||
## to ensure we lift assignment, destructors and moves properly.
|
## to ensure we lift assignment, destructors and moves properly.
|
||||||
|
|
|
||||||
|
|
@ -906,16 +906,26 @@ proc track(tracked: PEffects, n: PNode) =
|
||||||
of nkTypeSection, nkProcDef, nkConverterDef, nkMethodDef, nkIteratorDef,
|
of nkTypeSection, nkProcDef, nkConverterDef, nkMethodDef, nkIteratorDef,
|
||||||
nkMacroDef, nkTemplateDef, nkLambda, nkDo, nkFuncDef:
|
nkMacroDef, nkTemplateDef, nkLambda, nkDo, nkFuncDef:
|
||||||
discard
|
discard
|
||||||
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv:
|
of nkCast:
|
||||||
if n.len == 2:
|
if n.len == 2:
|
||||||
track(tracked, n[1])
|
track(tracked, n[1])
|
||||||
if tracked.owner.kind != skMacro:
|
if tracked.owner.kind != skMacro:
|
||||||
createTypeBoundOps(tracked, n.typ, n.info)
|
createTypeBoundOps(tracked, n.typ, n.info)
|
||||||
|
of nkHiddenStdConv, nkHiddenSubConv, nkConv:
|
||||||
|
if n.len == 2:
|
||||||
|
track(tracked, n[1])
|
||||||
|
if tracked.owner.kind != skMacro:
|
||||||
|
createTypeBoundOps(tracked, n.typ, n.info)
|
||||||
|
# This is a hacky solution in order to fix bug #13110. Hopefully
|
||||||
|
# a better solution will come up eventually.
|
||||||
|
if n[1].typ.kind != tyString:
|
||||||
|
createTypeBoundOps(tracked, n[1].typ, n[1].info)
|
||||||
of nkObjUpConv, nkObjDownConv, nkChckRange, nkChckRangeF, nkChckRange64:
|
of nkObjUpConv, nkObjDownConv, nkChckRange, nkChckRangeF, nkChckRange64:
|
||||||
if n.len == 1:
|
if n.len == 1:
|
||||||
track(tracked, n[0])
|
track(tracked, n[0])
|
||||||
if tracked.owner.kind != skMacro:
|
if tracked.owner.kind != skMacro:
|
||||||
createTypeBoundOps(tracked, n.typ, n.info)
|
createTypeBoundOps(tracked, n.typ, n.info)
|
||||||
|
createTypeBoundOps(tracked, n[0].typ, n[0].info)
|
||||||
of nkBracket:
|
of nkBracket:
|
||||||
for i in 0..<n.safeLen: track(tracked, n[i])
|
for i in 0..<n.safeLen: track(tracked, n[i])
|
||||||
if tracked.owner.kind != skMacro:
|
if tracked.owner.kind != skMacro:
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@ discard """
|
||||||
target: "c"
|
target: "c"
|
||||||
joinable: false
|
joinable: false
|
||||||
disabled: 32bit
|
disabled: 32bit
|
||||||
|
cmd: "nim c --gc:arc $file"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# bug #13110: This test failed with --gc:arc.
|
||||||
|
|
||||||
# this test wasn't written for 32 bit
|
# this test wasn't written for 32 bit
|
||||||
# don't join because the code is too messy.
|
# don't join because the code is too messy.
|
||||||
|
|
||||||
|
|
@ -527,7 +530,7 @@ proc findLeaf[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; leaf: L[D, RT, LT]): Le
|
||||||
proc condenseTree[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; leaf: Leaf[M, D, RT, LT]) =
|
proc condenseTree[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT]; leaf: Leaf[M, D, RT, LT]) =
|
||||||
var n: H[M, D, RT, LT] = leaf
|
var n: H[M, D, RT, LT] = leaf
|
||||||
var q = newSeq[H[M, D, RT, LT]]()
|
var q = newSeq[H[M, D, RT, LT]]()
|
||||||
var b: type(leaf.a[0].b)
|
var b: typeof(leaf.a[0].b)
|
||||||
while n != t.root:
|
while n != t.root:
|
||||||
let p = Node[M, D, RT, LT](n.parent)
|
let p = Node[M, D, RT, LT](n.parent)
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue