about summary refs log tree commit diff stats
path: root/056recipe_header.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-31 17:28:17 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-31 17:28:17 -0700
commitb7cd91a6b407b4ab4f1365cff0cb56e48db4cb6b (patch)
tree6d98c16eed6133da6a3340975c160b6200882152 /056recipe_header.cc
parent3fdb963b142774e432c35eea5cb45e40f8152cdb (diff)
downloadmu-b7cd91a6b407b4ab4f1365cff0cb56e48db4cb6b.tar.gz
2333
Diffstat (limited to '056recipe_header.cc')
-rw-r--r--056recipe_header.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc
index 8e8a84ab..79284ce5 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -131,11 +131,19 @@ void deduce_types_from_header(const recipe_ordinal r) {
     trace(9992, "transform") << inst.to_string() << end();
     for (long long int i = 0; i < SIZE(inst.ingredients); ++i) {
       if (inst.ingredients.at(i).type) continue;
+      if (header.find(inst.ingredients.at(i).name) == header.end()) {
+        raise << maybe(rr.name) << "unknown variable " << inst.ingredients.at(i).name << " in '" << inst.to_string() << "'\n" << end();
+        continue;
+      }
       inst.ingredients.at(i).type = new type_tree(*header[inst.ingredients.at(i).name]);
       trace(9993, "transform") << "type of " << inst.ingredients.at(i).name << " is " << dump_types(inst.ingredients.at(i)) << end();
     }
     for (long long int i = 0; i < SIZE(inst.products); ++i) {
       if (inst.products.at(i).type) continue;
+      if (header.find(inst.products.at(i).name) == header.end()) {
+        raise << maybe(rr.name) << "unknown variable " << inst.products.at(i).name << " in '" << inst.to_string() << "'\n" << end();
+        continue;
+      }
       inst.products.at(i).type = new type_tree(*header[inst.products.at(i).name]);
       trace(9993, "transform") << "type of " << inst.products.at(i).name << " is " << dump_types(inst.products.at(i)) << end();
     }