mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 21:04:20 +00:00
fixes #2758
This commit is contained in:
@@ -471,6 +471,7 @@ proc setupArgsForParallelism(n: PNode; objType: PType; scratchObj: PSym;
|
||||
let slice = newNodeI(nkCall, n.info, 4)
|
||||
slice.typ = n.typ
|
||||
slice.sons[0] = newSymNode(createMagic("slice", mSlice))
|
||||
slice.sons[0].typ = getSysType(tyInt) # fake type
|
||||
var fieldB = newSym(skField, tmpName, objType.owner, n.info)
|
||||
fieldB.typ = getSysType(tyInt)
|
||||
objType.addField(fieldB)
|
||||
|
||||
@@ -74,8 +74,6 @@ type
|
||||
currentSpawnId: int
|
||||
inLoop: int
|
||||
|
||||
let opSlice = createMagic("slice", mSlice)
|
||||
|
||||
proc initAnalysisCtx(): AnalysisCtx =
|
||||
result.locals = @[]
|
||||
result.slices = @[]
|
||||
@@ -399,7 +397,9 @@ proc transformSlices(n: PNode): PNode =
|
||||
let op = n[0].sym
|
||||
if op.name.s == "[]" and op.fromSystem:
|
||||
result = copyNode(n)
|
||||
result.add opSlice.newSymNode
|
||||
let opSlice = newSymNode(createMagic("slice", mSlice))
|
||||
opSlice.typ = getSysType(tyInt)
|
||||
result.add opSlice
|
||||
result.add n[1]
|
||||
let slice = n[2].skipStmtList
|
||||
result.add slice[1]
|
||||
|
||||
Reference in New Issue
Block a user