about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-15 18:36:34 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-15 18:36:34 -0800
commit5c6840b81b7c74afd6ae65cd96ad229ddfad7503 (patch)
treeb8a203a7c03fb178d4b2bb4f8fb3dceef1241f0e /030container.cc
parent1361f5ce5aa68c2243d8319abcbb1d71f4bc7e04 (diff)
downloadmu-5c6840b81b7c74afd6ae65cd96ad229ddfad7503.tar.gz
2450 - another pesky bug
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/030container.cc b/030container.cc
index 3684a5ce..25303f39 100644
--- a/030container.cc
+++ b/030container.cc
@@ -156,6 +156,7 @@ case GET: {
     raise_error << maybe(get(Recipe, r).name) << "invalid offset " << offset_value << " for " << get(Type, base_type).name << '\n' << end();
     break;
   }
+  if (inst.products.empty()) break;
   reagent product = inst.products.at(0);
   // Update GET product in Check
   const reagent element = element_type(base, offset_value);
@@ -242,6 +243,16 @@ recipe main [
 ]
 +error: main: 'get' 1:offset (1) on point-number can't be saved in 15:address:number; type should be number but is <address : <number : <>>>
 
+//: we might want to call 'get' without saving the results, say in a sandbox
+
+:(scenario get_without_product)
+recipe main [
+  12:number <- copy 34
+  13:number <- copy 35
+  get 12:point/raw, 1:offset  # unsafe
+]
+# just don't die
+
 //:: To write to elements of containers, you need their address.
 
 :(scenario get_address)