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-05 14:13:26 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-05 14:13:26 -0800
commit8389d168e4e6eada19462cf70249c45508fd1f4d (patch)
tree29de397dd65b71181af8313f6bdf6b6b4fd5668b /030container.cc
parent356c966dc6de9d7a9306eb9da1b731d061331e5d (diff)
downloadmu-8389d168e4e6eada19462cf70249c45508fd1f4d.tar.gz
2373 - bad bug: instruction was losing /lookup
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/030container.cc b/030container.cc
index 03af439c..9fde367e 100644
--- a/030container.cc
+++ b/030container.cc
@@ -131,7 +131,7 @@ case GET: {
     raise_error << maybe(Recipe[r].name) << "'get' expects exactly 2 ingredients in '" << inst.to_string() << "'\n" << end();
     break;
   }
-  reagent base = inst.ingredients.at(0);
+  reagent base = inst.ingredients.at(0);  // new copy for every invocation
   // Update GET base in Check
   if (!base.type || !base.type->value || Type[base.type->value].kind != CONTAINER) {
     raise_error << maybe(Recipe[r].name) << "first ingredient of 'get' should be a container, but got " << inst.ingredients.at(0).original_string << '\n' << end();
@@ -152,7 +152,7 @@ case GET: {
     raise_error << maybe(Recipe[r].name) << "invalid offset " << offset_value << " for " << Type[base_type].name << '\n' << end();
     break;
   }
-  reagent& product = inst.products.at(0);
+  reagent product = inst.products.at(0);
   // Update GET product in Check
   const reagent element = element_type(base, offset_value);
   if (!types_match(product, element)) {