about summary refs log tree commit diff stats
path: root/031address.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-08-13 16:32:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-08-13 16:32:36 -0700
commit1ad3fe9e6134353362c9a1318b4ba52d3ecc0d75 (patch)
treedf349dea704fca028c8c29c87d6f34f59b706671 /031address.cc
parentdae2fa9688ce7b61ee2a46c0b616543ddbecd889 (diff)
downloadmu-1ad3fe9e6134353362c9a1318b4ba52d3ecc0d75.tar.gz
1988 - handle reagents without types
This can happen if 'canonize' fails. Make sure it doesn't kill mu.

Thanks Caleb Couch.
Diffstat (limited to '031address.cc')
-rw-r--r--031address.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/031address.cc b/031address.cc
index 94c23210..f0657b98 100644
--- a/031address.cc
+++ b/031address.cc
@@ -57,7 +57,7 @@ reagent lookup_memory(reagent x) {
 //?   cout << "lookup_memory: " << x.to_string() << "\n"; //? 2
   static const type_ordinal ADDRESS = Type_ordinal["address"];
   reagent result;
-  if (x.types.at(0) != ADDRESS) {
+  if (x.types.empty() || x.types.at(0) != ADDRESS) {
     raise << current_recipe_name() << ": tried to /lookup " << x.original_string << " but it isn't an address\n" << end();
     return result;
   }