diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-08-13 16:32:36 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-08-13 16:32:36 -0700 |
commit | 1ad3fe9e6134353362c9a1318b4ba52d3ecc0d75 (patch) | |
tree | df349dea704fca028c8c29c87d6f34f59b706671 /032array.cc | |
parent | dae2fa9688ce7b61ee2a46c0b616543ddbecd889 (diff) | |
download | mu-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 '032array.cc')
-rw-r--r-- | 032array.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/032array.cc b/032array.cc index bf51382d..412f6878 100644 --- a/032array.cc +++ b/032array.cc @@ -94,7 +94,7 @@ case INDEX: { break; } reagent base = canonize(current_instruction().ingredients.at(0)); - if (base.types.at(0) != Type_ordinal["array"]) { + if (!is_mu_array(base)) { raise << current_recipe_name () << ": 'index' on a non-array " << base.original_string << '\n' << end(); break; } @@ -189,7 +189,7 @@ case INDEX_ADDRESS: { break; } reagent base = canonize(current_instruction().ingredients.at(0)); - if (base.types.at(0) != Type_ordinal["array"]) { + if (!is_mu_array(base)) { raise << current_recipe_name () << ": 'index-address' on a non-array " << base.original_string << '\n' << end(); break; } @@ -264,7 +264,7 @@ case LENGTH: { break; } reagent x = canonize(current_instruction().ingredients.at(0)); - if (x.types.at(0) != Type_ordinal["array"]) { + if (!is_mu_array(x)) { raise << "tried to calculate length of non-array " << x.original_string << '\n' << end(); break; } |