about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-04-10 18:57:37 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-04-10 18:57:37 -0700
commit8e34d4bb571527aa9d5b09b29fbc1a578c754d1c (patch)
tree351a113667a5c8c47ec9639960d0136e9de1cef8
parent4f939d9a38210ce28a8390969a5a64926f4f2fe7 (diff)
downloadmu-8e34d4bb571527aa9d5b09b29fbc1a578c754d1c.tar.gz
2826
-rw-r--r--031container.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/031container.cc b/031container.cc
index 27210c83..00080b19 100644
--- a/031container.cc
+++ b/031container.cc
@@ -323,14 +323,12 @@ case GET_ADDRESS: {
   else {
     offset_value = offset.value;
   }
-  reagent product = inst.products.at(0);
-  if (!canonize_type(base)) break;
   // same type as for GET..
   reagent element = element_type(base, offset_value);
   // ..except for an address at the start
   element.type = new type_tree("address", get(Type_ordinal, "address"), element.type);
-  if (!types_coercible(product, element)) {
-    raise << maybe(get(Recipe, r).name) << "'get-address " << base.original_string << ", " << offset.original_string << "' should write to " << names_to_string_without_quotes(element.type) << " but " << product.name << " has type " << names_to_string_without_quotes(product.type) << '\n' << end();
+  if (!types_coercible(inst.products.at(0), element)) {
+    raise << maybe(get(Recipe, r).name) << "'get-address " << base.original_string << ", " << offset.original_string << "' should write to " << names_to_string_without_quotes(element.type) << " but " << inst.products.at(0).name << " has type " << names_to_string_without_quotes(inst.products.at(0).type) << '\n' << end();
     break;
   }
   break;
@@ -399,6 +397,16 @@ def main [
 ]
 +mem: storing 2 in location 4
 
+:(scenario get_address_indirect2)
+def main [
+  1:number <- copy 2
+  2:number <- copy 34
+  3:number <- copy 35
+  4:address:number <- copy 5/unsafe
+  4:address:number/lookup <- get-address 1:address:point/lookup, 0:offset
+]
++mem: storing 2 in location 5
+
 //:: Allow containers to be defined in mu code.
 
 :(scenarios load)