diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-17 11:25:00 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-17 11:25:00 -0800 |
commit | c6354606d412b7719ab7078b59c015d580520bde (patch) | |
tree | 850da3f23f90b7680fe3dca4f1017c9dc9615c3d /042name.cc | |
parent | 5729eb517bd6bdbfb08ec95d04d3e3baf22e81b8 (diff) | |
download | mu-c6354606d412b7719ab7078b59c015d580520bde.tar.gz |
2456
Diffstat (limited to '042name.cc')
-rw-r--r-- | 042name.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/042name.cc b/042name.cc index b25ca533..e9812624 100644 --- a/042name.cc +++ b/042name.cc @@ -204,8 +204,10 @@ if (inst.name == "get" || inst.name == "get-address") { if (inst.ingredients.at(1).name.find_first_not_of("0123456789") != string::npos) { // since first non-address in base type must be a container, we don't have to canonize type_ordinal base_type = skip_addresses(inst.ingredients.at(0).type, get(Recipe, r).name); - inst.ingredients.at(1).set_value(find_element_name(base_type, inst.ingredients.at(1).name, get(Recipe, r).name)); - trace(9993, "name") << "element " << inst.ingredients.at(1).name << " of type " << get(Type, base_type).name << " is at offset " << no_scientific(inst.ingredients.at(1).value) << end(); + if (contains_key(Type, base_type)) { // otherwise we'll raise an error elsewhere + inst.ingredients.at(1).set_value(find_element_name(base_type, inst.ingredients.at(1).name, get(Recipe, r).name)); + trace(9993, "name") << "element " << inst.ingredients.at(1).name << " of type " << get(Type, base_type).name << " is at offset " << no_scientific(inst.ingredients.at(1).value) << end(); + } } } @@ -243,7 +245,9 @@ if (inst.name == "maybe-convert") { if (inst.ingredients.at(1).name.find_first_not_of("0123456789") != string::npos) { // since first non-address in base type must be an exclusive container, we don't have to canonize type_ordinal base_type = skip_addresses(inst.ingredients.at(0).type, get(Recipe, r).name); - inst.ingredients.at(1).set_value(find_element_name(base_type, inst.ingredients.at(1).name, get(Recipe, r).name)); - trace(9993, "name") << "variant " << inst.ingredients.at(1).name << " of type " << get(Type, base_type).name << " has tag " << no_scientific(inst.ingredients.at(1).value) << end(); + if (contains_key(Type, base_type)) { // otherwise we'll raise an error elsewhere + inst.ingredients.at(1).set_value(find_element_name(base_type, inst.ingredients.at(1).name, get(Recipe, r).name)); + trace(9993, "name") << "variant " << inst.ingredients.at(1).name << " of type " << get(Type, base_type).name << " has tag " << no_scientific(inst.ingredients.at(1).value) << end(); + } } } |