about summary refs log tree commit diff stats
path: root/055shape_shifting_container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-19 00:39:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-19 00:39:22 -0700
commit34171bdac5602dbbda862c5ad2e247a8dd5bf3a3 (patch)
treee20f7bb3e923d95b0f6028ec9f5e270befe7ebf2 /055shape_shifting_container.cc
parent537ad74cccc709b14418114e177d595ce3812627 (diff)
downloadmu-34171bdac5602dbbda862c5ad2e247a8dd5bf3a3.tar.gz
3863
Thanks Lakshman Swaminathan for running into this bug.
Diffstat (limited to '055shape_shifting_container.cc')
-rw-r--r--055shape_shifting_container.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/055shape_shifting_container.cc b/055shape_shifting_container.cc
index 6083f904..a9225960 100644
--- a/055shape_shifting_container.cc
+++ b/055shape_shifting_container.cc
@@ -555,15 +555,17 @@ def main [
 
 :(before "End compute_container_sizes Non-atom Special-cases")
 const type_tree* root = get_base_type(type);
-type_info& info = get(Type, root->value);
-if (info.kind == CONTAINER) {
-  compute_container_sizes(info, type, pending_metadata, location_for_error_messages);
-  return;
-}
-if (info.kind == EXCLUSIVE_CONTAINER) {
-  compute_exclusive_container_sizes(info, type, pending_metadata, location_for_error_messages);
-  return;
-}
+if (contains_key(Type, root->value)) {
+  type_info& info = get(Type, root->value);
+  if (info.kind == CONTAINER) {
+    compute_container_sizes(info, type, pending_metadata, location_for_error_messages);
+    return;
+  }
+  if (info.kind == EXCLUSIVE_CONTAINER) {
+    compute_exclusive_container_sizes(info, type, pending_metadata, location_for_error_messages);
+    return;
+  }
+}  // otherwise error raised elsewhere
 
 :(before "End Unit Tests")
 void test_container_sizes_shape_shifting_container() {