a better bugfix

This commit is contained in:
Araq 2019-12-23 13:05:30 +01:00 • committed by Andreas Rumpf
commit 6152eb3be3
2 changed files with 36 additions and 33 deletions

View file

@ -362,13 +362,13 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: var TLoc,
linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfo(p.module, t, a.lode.info)])
of frEmbedded:
if optTinyRtti in p.config.globalOptions:
var n = newNodeIT(nkObjConstr, a.lode.info, t)
n.add newNodeIT(nkType, a.lode.info, t)
if mode == constructRefObj:
var n = newNodeIT(nkObjConstr, a.lode.info, t)
n.add newNodeIT(nkType, a.lode.info, t)
genObjConstr(p, n, a)
else:
var tmp: TLoc
rawConstExpr(p, n, tmp)
rawConstExpr(p, newNodeIT(nkType, a.lode.info, t), tmp)
genAssignment(p, a, tmp, {})
else:
# worst case for performance: