From 1e38eee5db71d551ee2dbddb35d187489e372c8c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 26 Feb 2016 21:50:54 -0800 Subject: 2718 - stop crashing on unknown space I'm going to stop wasting precious first-line characters on 'bugfix:'. It's going to be all bugfixes for a while I think. --- 045closure_name.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to '045closure_name.cc') diff --git a/045closure_name.cc b/045closure_name.cc index 2b80e154..368377fd 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -101,6 +101,7 @@ long long int lookup_name(const reagent& x, const recipe_ordinal default_recipe) long long int n = to_integer(p->value); assert(n >= 0); recipe_ordinal surrounding_recipe = lookup_surrounding_recipe(default_recipe, n); + if (surrounding_recipe == -1) return -1; set done; vector path; return lookup_name(x, surrounding_recipe, done, path); @@ -116,7 +117,7 @@ long long int lookup_name(const reagent& x, const recipe_ordinal r, set& nam } return contains_key(names, r.name); } + +:(scenario missing_surrounding_space) +% Hide_errors = true; +recipe f [ + local-scope + x:number/space:1 <- copy 34 +] ++error: don't know surrounding recipe of f ++error: f: can't find a place to store x -- cgit 1.4.1-2-gfad0