about summary refs log tree commit diff stats
path: root/071recipe.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-20 17:41:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-20 17:41:56 -0700
commit59d827a27472d90cb7d22be8ef6a3b161fb1c0dc (patch)
tree90f780987b0d568ca6c58ff3856d9da98ed32052 /071recipe.cc
parent0e0982df964311e040862f0381bce47cd21ae9d5 (diff)
downloadmu-59d827a27472d90cb7d22be8ef6a3b161fb1c0dc.tar.gz
3529
Bugfix: refcounts were getting updated for the wrong ingredients in
'call' instructions.
Diffstat (limited to '071recipe.cc')
-rw-r--r--071recipe.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/071recipe.cc b/071recipe.cc
index 4a8caefd..9135feda 100644
--- a/071recipe.cc
+++ b/071recipe.cc
@@ -114,7 +114,9 @@ case CALL: {
     raise << maybe(current_recipe_name()) << "tried to call empty recipe in '" << to_string(current_instruction()) << "'" << end();
     break;
   }
-  const instruction& call_instruction = current_instruction();
+  instruction/*copy*/ call_instruction = current_instruction();
+  call_instruction.operation = ingredients.at(0).at(0);
+  call_instruction.ingredients.erase(call_instruction.ingredients.begin());
   Current_routine->calls.push_front(call(ingredients.at(0).at(0)));
   ingredients.erase(ingredients.begin());  // drop the callee
   finish_call_housekeeping(call_instruction, ingredients);