From 37a3eb5170e2f6c9c0e6489bd40f1b4cd8200eb5 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 16 Mar 2018 15:55:46 +0100 Subject: [PATCH] make 'memset' calls more robust; refs #7341 --- compiler/cgen.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 57a0f0679..01610010b 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -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) =