From 75aa3a98e2b9311d65df91523ec754d5a2770456 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 6 Oct 2015 18:49:56 -0700 Subject: 2257 --- 035call_ingredient.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/035call_ingredient.cc b/035call_ingredient.cc index 3772c644..fd8e7508 100644 --- a/035call_ingredient.cc +++ b/035call_ingredient.cc @@ -56,8 +56,13 @@ case NEXT_INGREDIENT: { else { if (SIZE(current_instruction().products) < 2) raise << maybe(current_recipe_name()) << "no ingredient to save in " << current_instruction().products.at(0).original_string << '\n' << end(); + if (current_instruction().products.empty()) break; products.resize(2); - products.at(0).push_back(0); // todo: will fail noisily if we try to read a compound value + // pad the first product with sufficient zeros to match its type + long long int size = size_of(current_instruction().products.at(0)); + for (long long int i = 0; i < size; ++i) { + products.at(0).push_back(0); + } products.at(1).push_back(0); } break; -- cgit 1.4.1-2-gfad0