aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2016-12-09 04:26:11 -0500
committerQuentin Carbonneaux <[email protected]>2016-12-12 19:24:39 -0500
commit2380b5786a515af7149f7648d9e9c22a663e3a9c (patch)
treea6dd0174cfc55f81c2f2b660032b8feb7998a703 /util.c
parent00f3d2228b96c03e63091f4c92fee0478f39328e (diff)
make newtmp() return zeroed out temporaries
This was not necessary as temporaries were never freed and returned from an array zero initialized. But in the coming load optimization, we sometimes free temporaries by resetting fn->ntmp.
Diffstat (limited to 'util.c')
-rw-r--r--util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util.c b/util.c
index a99e2dd..63a1202 100644
--- a/util.c
+++ b/util.c
@@ -250,6 +250,7 @@ newtmp(char *prfx, int k, Fn *fn)
t = fn->ntmp++;
vgrow(&fn->tmp, fn->ntmp);
+ memset(&fn->tmp[t], 0, sizeof(Tmp));
if (prfx)
sprintf(fn->tmp[t].name, "%s.%d", prfx, ++n);
fn->tmp[t].cls = k;