fixes #2758
This commit is contained in:
parent
ab3c684c62
commit
153fd13f3d
2 changed files with 4 additions and 3 deletions
|
|
@ -471,6 +471,7 @@ proc setupArgsForParallelism(n: PNode; objType: PType; scratchObj: PSym;
|
||||||
let slice = newNodeI(nkCall, n.info, 4)
|
let slice = newNodeI(nkCall, n.info, 4)
|
||||||
slice.typ = n.typ
|
slice.typ = n.typ
|
||||||
slice.sons[0] = newSymNode(createMagic("slice", mSlice))
|
slice.sons[0] = newSymNode(createMagic("slice", mSlice))
|
||||||
|
slice.sons[0].typ = getSysType(tyInt) # fake type
|
||||||
var fieldB = newSym(skField, tmpName, objType.owner, n.info)
|
var fieldB = newSym(skField, tmpName, objType.owner, n.info)
|
||||||
fieldB.typ = getSysType(tyInt)
|
fieldB.typ = getSysType(tyInt)
|
||||||
objType.addField(fieldB)
|
objType.addField(fieldB)
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,6 @@ type
|
||||||
currentSpawnId: int
|
currentSpawnId: int
|
||||||
inLoop: int
|
inLoop: int
|
||||||
|
|
||||||
let opSlice = createMagic("slice", mSlice)
|
|
||||||
|
|
||||||
proc initAnalysisCtx(): AnalysisCtx =
|
proc initAnalysisCtx(): AnalysisCtx =
|
||||||
result.locals = @[]
|
result.locals = @[]
|
||||||
result.slices = @[]
|
result.slices = @[]
|
||||||
|
|
@ -399,7 +397,9 @@ proc transformSlices(n: PNode): PNode =
|
||||||
let op = n[0].sym
|
let op = n[0].sym
|
||||||
if op.name.s == "[]" and op.fromSystem:
|
if op.name.s == "[]" and op.fromSystem:
|
||||||
result = copyNode(n)
|
result = copyNode(n)
|
||||||
result.add opSlice.newSymNode
|
let opSlice = newSymNode(createMagic("slice", mSlice))
|
||||||
|
opSlice.typ = getSysType(tyInt)
|
||||||
|
result.add opSlice
|
||||||
result.add n[1]
|
result.add n[1]
|
||||||
let slice = n[2].skipStmtList
|
let slice = n[2].skipStmtList
|
||||||
result.add slice[1]
|
result.add slice[1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue