about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-30 09:53:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-30 09:53:36 -0700
commit841387aea82a398e86871c54132bb5d6b19ddca4 (patch)
tree20d66b0f6de8fb45385ec26319e3b4d3d7631428
parentd36ae5651435a477e34d9e1338ee3ca79d949b1c (diff)
downloadmu-841387aea82a398e86871c54132bb5d6b19ddca4.tar.gz
2888
-rw-r--r--030container.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/030container.cc b/030container.cc
index 35b2d89b..879688a9 100644
--- a/030container.cc
+++ b/030container.cc
@@ -104,6 +104,8 @@ if (!contains_key(Type, type->value)) {
 }
 type_info t = get(Type, type->value);
 if (t.kind == CONTAINER) {
+  reagent reagent_containing_type;
+  reagent_containing_type.type = new type_tree(*type);
   // size of a container is the sum of the sizes of its elements
   int result = 0;
   for (int i = 0; i < SIZE(t.elements); ++i) {
@@ -112,9 +114,7 @@ if (t.kind == CONTAINER) {
       raise << "container " << t.name << " can't include itself as a member\n" << end();
       return 0;
     }
-    reagent tmp;
-    tmp.type = new type_tree(*type);
-    result += size_of(element_type(tmp, i));
+    result += size_of(element_type(reagent_containing_type, i));
   }
   return result;
 }