about summary refs log tree commit diff stats
path: root/032array.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 /032array.cc
parent537ad74cccc709b14418114e177d595ce3812627 (diff)
downloadmu-34171bdac5602dbbda862c5ad2e247a8dd5bf3a3.tar.gz
3863
Thanks Lakshman Swaminathan for running into this bug.
Diffstat (limited to '032array.cc')
-rw-r--r--032array.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/032array.cc b/032array.cc
index 64264ef8..7c134bdb 100644
--- a/032array.cc
+++ b/032array.cc
@@ -269,6 +269,17 @@ void test_container_sizes_from_repeated_address_and_array_types() {
   CHECK_EQ(SIZE(Container_metadata)-old_size, 1);
 }
 
+void test_container_sizes_on_unknown_type() {
+  // a container we don't have the size for
+  reagent container("x:point");
+  int old_size = SIZE(Container_metadata);
+  // scanning address to array with a typo
+  reagent r("x:address:array:adress:number");
+  compute_container_sizes(r, "");  // should not crash
+  // no non-container types precomputed
+  CHECK_EQ(SIZE(Container_metadata), old_size);
+}
+
 //:: To access elements of an array, use 'index'
 
 :(scenario index)