diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-09 11:03:49 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-09 12:06:04 -0700 |
commit | 97a418438d79fed91e8564bea64e31c670e994b2 (patch) | |
tree | 0af8bf18c82fda19bda9ebb82346c9e3a7493887 /033exclusive_container.cc | |
parent | f9d069b53ca8733753346262ab10a4ac05d28db2 (diff) | |
download | mu-97a418438d79fed91e8564bea64e31c670e994b2.tar.gz |
3307
Diffstat (limited to '033exclusive_container.cc')
-rw-r--r-- | 033exclusive_container.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/033exclusive_container.cc b/033exclusive_container.cc index 462521dd..ff384de5 100644 --- a/033exclusive_container.cc +++ b/033exclusive_container.cc @@ -37,19 +37,19 @@ if (t.kind == EXCLUSIVE_CONTAINER) { } :(before "End compute_container_sizes Cases") if (info.kind == EXCLUSIVE_CONTAINER) { - container_metadata metadata; // size of an exclusive container is the size of its largest variant - // (So like containers, it can't contain arrays.) - int size = 0; + // (So, like containers, it can only contain arrays if they're static and + // include their length in the type.) + container_metadata metadata; for (int i = 0; i < SIZE(info.elements); ++i) { reagent/*copy*/ element = info.elements.at(i); // Compute Exclusive Container Size(element) compute_container_sizes(element.type, pending_metadata); int variant_size = size_of(element); - if (variant_size > size) size = variant_size; + if (variant_size > metadata.size) metadata.size = variant_size; } // ...+1 for its tag. - metadata.size = size+1; + ++metadata.size; Container_metadata.push_back(pair<type_tree*, container_metadata>(new type_tree(*type), metadata)); } |