make 'memset' calls more robust; refs #7341

This commit is contained in:
Andreas Rumpf
2018-03-16 15:55:46 +01:00
parent b1ab9d551f
commit 37a3eb5170

View File

@@ -337,7 +337,7 @@ proc constructLoc(p: BProc, loc: TLoc, isTemp = false) =
if not isImportedCppType(typ):
useStringh(p.module)
linefmt(p, cpsStmts, "memset((void*)$1, 0, sizeof($2));$n",
addrLoc(loc), rdLoc(loc))
addrLoc(loc), getTypeDesc(p.module, typ))
genObjectInit(p, cpsStmts, loc.t, loc, true)
proc initLocalVar(p: BProc, v: PSym, immediateAsgn: bool) =