about summary refs log tree commit diff stats
path: root/036call_reply.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-24 18:41:26 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-24 18:41:26 -0800
commitabc702166985f17e79e23a44865b596b82480226 (patch)
tree619fb77d5c2be8f1cba971443db966e02819cff0 /036call_reply.cc
parent9923285547c1cd4e1fdb56262ec85284b39b8779 (diff)
downloadmu-abc702166985f17e79e23a44865b596b82480226.tar.gz
2601 - fix crash
Diffstat (limited to '036call_reply.cc')
-rw-r--r--036call_reply.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/036call_reply.cc b/036call_reply.cc
index a3bc0855..da824d9e 100644
--- a/036call_reply.cc
+++ b/036call_reply.cc
@@ -101,8 +101,10 @@ void check_types_of_reply_instructions(recipe_ordinal r) {
             goto finish_reply_check;
           }
           long long int ingredient_index = to_integer(tmp->value);
-          if (ingredient_index >= SIZE(caller_instruction.ingredients))
-            raise_error << maybe(caller.name) << "'same-as-ingredient' metadata overflows ingredients in: " << caller_instruction.to_string() << '\n' << end();
+          if (ingredient_index >= SIZE(caller_instruction.ingredients)) {
+            raise_error << maybe(caller.name) << "too few ingredients in '" << caller_instruction.to_string() << "'\n" << end();
+            goto finish_reply_check;
+          }
           if (!is_dummy(caller_instruction.products.at(i)) && caller_instruction.products.at(i).name != caller_instruction.ingredients.at(ingredient_index).name)
             raise_error << maybe(caller.name) << "'" << caller_instruction.to_string() << "' should write to " << caller_instruction.ingredients.at(ingredient_index).original_string << " rather than " << caller_instruction.products.at(i).original_string << '\n' << end();
         }