mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-16 22:11:18 +00:00
fixes recently introduced regression
This commit is contained in:
@@ -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.
|
||||
if not isAddr and unneededIndirection(n.sons[0]):
|
||||
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})
|
||||
else:
|
||||
let tmp = c.genx(n.sons[0], newflags)
|
||||
@@ -1137,6 +1137,9 @@ proc isTemp(c: PCtx; dest: TDest): bool =
|
||||
template needsAdditionalCopy(n): expr =
|
||||
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;
|
||||
dest, idx, value: TRegister) =
|
||||
# opcLdObj et al really means "load address". We sometimes have to create a
|
||||
|
||||
Reference in New Issue
Block a user