diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-12-09 04:26:11 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-12-12 19:24:39 -0500 |
commit | 2380b5786a515af7149f7648d9e9c22a663e3a9c (patch) | |
tree | a6dd0174cfc55f81c2f2b660032b8feb7998a703 | |
parent | 00f3d2228b96c03e63091f4c92fee0478f39328e (diff) | |
download | roux-2380b5786a515af7149f7648d9e9c22a663e3a9c.tar.gz |
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.
-rw-r--r-- | util.c | 1 |
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; |