fixes recently introduced regression
This commit is contained in:
parent
c7116cc121
commit
4c870fc293
1 changed files with 4 additions and 1 deletions
|
|
@ -1057,7 +1057,7 @@ proc genAddrDeref(c: PCtx; n: PNode; dest: var TDest; opc: TOpcode;
|
||||||
# nkAddr we must not use 'unneededIndirection', but for deref we use it.
|
# nkAddr we must not use 'unneededIndirection', but for deref we use it.
|
||||||
if not isAddr and unneededIndirection(n.sons[0]):
|
if not isAddr and unneededIndirection(n.sons[0]):
|
||||||
gen(c, n.sons[0], dest, newflags)
|
gen(c, n.sons[0], dest, newflags)
|
||||||
elif isGlobal(n.sons[0]):
|
elif isAddr and isGlobal(n.sons[0]):
|
||||||
gen(c, n.sons[0], dest, flags+{gfAddrOf})
|
gen(c, n.sons[0], dest, flags+{gfAddrOf})
|
||||||
else:
|
else:
|
||||||
let tmp = c.genx(n.sons[0], newflags)
|
let tmp = c.genx(n.sons[0], newflags)
|
||||||
|
|
@ -1137,6 +1137,9 @@ proc isTemp(c: PCtx; dest: TDest): bool =
|
||||||
template needsAdditionalCopy(n): expr =
|
template needsAdditionalCopy(n): expr =
|
||||||
not c.isTemp(dest) and not fitsRegister(n.typ)
|
not c.isTemp(dest) and not fitsRegister(n.typ)
|
||||||
|
|
||||||
|
proc skipDeref(n: PNode): PNode =
|
||||||
|
result = if n.kind in {nkDerefExpr, nkHiddenDeref}: n.sons[0] else n
|
||||||
|
|
||||||
proc preventFalseAlias(c: PCtx; n: PNode; opc: TOpcode;
|
proc preventFalseAlias(c: PCtx; n: PNode; opc: TOpcode;
|
||||||
dest, idx, value: TRegister) =
|
dest, idx, value: TRegister) =
|
||||||
# opcLdObj et al really means "load address". We sometimes have to create a
|
# opcLdObj et al really means "load address". We sometimes have to create a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue