parent
8407a57499
commit
afbcd1b330
34 changed files with 530 additions and 314 deletions
|
|
@ -596,12 +596,12 @@ proc genField(c: PCtx; n: PNode): TRegister =
|
|||
|
||||
proc genIndex(c: PCtx; n: PNode; arr: PType): TRegister =
|
||||
if arr.skipTypes(abstractInst).kind == tyArray and (let x = firstOrd(c.config, arr);
|
||||
x != 0):
|
||||
x != Zero):
|
||||
let tmp = c.genx(n)
|
||||
# freeing the temporary here means we can produce: regA = regA - Imm
|
||||
c.freeTemp(tmp)
|
||||
result = c.getTemp(n.typ)
|
||||
c.gABI(n, opcSubImmInt, result, tmp, x.int)
|
||||
c.gABI(n, opcSubImmInt, result, tmp, toInt(x))
|
||||
else:
|
||||
result = c.genx(n)
|
||||
|
||||
|
|
@ -1767,7 +1767,7 @@ proc getNullValue(typ: PType, info: TLineInfo; conf: ConfigRef): PNode =
|
|||
getNullValueAux(t, t.n, result, conf, currPosition)
|
||||
of tyArray:
|
||||
result = newNodeIT(nkBracket, info, t)
|
||||
for i in 0 ..< int(lengthOrd(conf, t)):
|
||||
for i in 0 ..< toInt(lengthOrd(conf, t)):
|
||||
addSon(result, getNullValue(elemType(t), info, conf))
|
||||
of tyTuple:
|
||||
result = newNodeIT(nkTupleConstr, info, t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue