diff src/variables.cc @ 1281:fcdf6c5d0302

[project @ 1995-04-27 19:21:47 by jwe]
author jwe
date Thu, 27 Apr 1995 19:23:54 +0000
parents db4f4009d6e8
children 611d403c7f3d
line wrap: on
line diff
--- a/src/variables.cc	Wed Apr 26 17:49:19 1995 +0000
+++ b/src/variables.cc	Thu Apr 27 19:23:54 1995 +0000
@@ -1440,11 +1440,15 @@
 bind_ans (const tree_constant& val, int print)
 {
   static symbol_record *sr = global_sym_tab->lookup ("ans", 1, 0);
-  static tree_identifier ans_id (sr);
 
+  tree_identifier *ans_id = new tree_identifier (sr);
   tree_constant *tmp = new tree_constant (val);
 
-  tree_simple_assignment_expression tmp_ass (&ans_id, tmp, 1, 1);
+  // XXX FIXME XXX -- making ans_id static, passing its address to
+  // tree_simple_assignment_expression along with a flag to not delete
+  // it seems to create a memory leak.  Hmm.
+
+  tree_simple_assignment_expression tmp_ass (ans_id, tmp, 0, 1);
 
   tmp_ass.eval (print);
 }