make 'memset' calls more robust; refs #7341
This commit is contained in:
parent
9f17a56896
commit
08282b1355
1 changed files with 2 additions and 1 deletions
|
|
@ -1910,7 +1910,8 @@ proc genSetConstr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
if getSize(e.typ) > 8:
|
if getSize(e.typ) > 8:
|
||||||
# big set:
|
# big set:
|
||||||
useStringh(p.module)
|
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):
|
for i in countup(0, sonsLen(e) - 1):
|
||||||
if e.sons[i].kind == nkRange:
|
if e.sons[i].kind == nkRange:
|
||||||
getTemp(p, getSysType(tyInt), idx) # our counter
|
getTemp(p, getSysType(tyInt), idx) # our counter
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue