Browse Source

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.
Quentin Carbonneaux 9 years ago
parent
commit
2380b5786a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      util.c

+ 1 - 0
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;