diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-24 01:17:36 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-24 01:17:36 -0700 |
commit | eefde1b934044bce32db4ee2dce7f9917d7c840d (patch) | |
tree | c51d214568328c04ac07c6c4eba4aa8be03ae960 | |
parent | 46026f62877a1c6c218f9d551ce2e261298f2540 (diff) | |
download | mu-eefde1b934044bce32db4ee2dce7f9917d7c840d.tar.gz |
1836
-rw-r--r-- | 033exclusive_container.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/033exclusive_container.cc b/033exclusive_container.cc index b1600032..dfdcdd61 100644 --- a/033exclusive_container.cc +++ b/033exclusive_container.cc @@ -94,8 +94,14 @@ case MAYBE_CONVERT: { reagent base = canonize(current_instruction().ingredients.at(0)); long long int base_address = base.value; type_ordinal base_type = base.types.at(0); - assert(Type[base_type].kind == exclusive_container); - assert(is_literal(current_instruction().ingredients.at(1))); + if (Type[base_type].kind != exclusive_container) { + raise << current_recipe_name () << ": 'maybe-convert' on a non-exclusive-container " << base.original_string << '\n'; + break; + } + if (!is_literal(current_instruction().ingredients.at(1))) { + raise << current_recipe_name() << ": expected ingredient 1 of 'get' to have type 'variant', got '" << current_instruction().ingredients.at(1).original_string << "'\n"; + break; + } long long int tag = current_instruction().ingredients.at(1).value; long long int result; if (tag == static_cast<long long int>(Memory[base_address])) { |