mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 20:04:18 +00:00
make 'memset' calls more robust; refs #7341
This commit is contained in:
@@ -1910,7 +1910,8 @@ proc genSetConstr(p: BProc, e: PNode, d: var TLoc) =
|
||||
if getSize(e.typ) > 8:
|
||||
# big set:
|
||||
useStringh(p.module)
|
||||
lineF(p, cpsStmts, "memset($1, 0, sizeof($1));$n", [rdLoc(d)])
|
||||
lineF(p, cpsStmts, "memset($1, 0, sizeof($2));$n",
|
||||
[rdLoc(d), getTypeDesc(p.module, e.typ)])
|
||||
for i in countup(0, sonsLen(e) - 1):
|
||||
if e.sons[i].kind == nkRange:
|
||||
getTemp(p, getSysType(tyInt), idx) # our counter
|
||||
|
||||
Reference in New Issue
Block a user