about summary refs log tree commit diff stats
path: root/046closure_name.cc
diff options
context:
space:
mode:
Diffstat (limited to '046closure_name.cc')
-rw-r--r--046closure_name.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/046closure_name.cc b/046closure_name.cc
index 75803f2d..11945c76 100644
--- a/046closure_name.cc
+++ b/046closure_name.cc
@@ -41,6 +41,7 @@ Transform.push_back(collect_surrounding_spaces);
 :(code)
 void collect_surrounding_spaces(const recipe_ordinal r) {
   trace(9991, "transform") << "--- collect surrounding spaces for recipe " << get(Recipe, r).name << end();
+//?   cerr << "--- collect surrounding spaces for recipe " << get(Recipe, r).name << '\n';
   for (long long int i = 0; i < SIZE(get(Recipe, r).steps); ++i) {
     const instruction& inst = get(Recipe, r).steps.at(i);
     if (inst.is_label) continue;
@@ -71,6 +72,11 @@ void collect_surrounding_spaces(const recipe_ordinal r) {
         continue;
       }
       trace(9993, "name") << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << end();
+//?       cerr << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << '\n';
+      if (!contains_key(Recipe_ordinal, surrounding_recipe_name)) {
+        raise << "can't find recipe providing surrounding space for " << get(Recipe, r).name << ": " << surrounding_recipe_name << '\n' << end();
+        continue;
+      }
       Surrounding_space[r] = get(Recipe_ordinal, surrounding_recipe_name);
     }
   }