summaryrefslogtreecommitdiff
path: root/src/parsing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parsing.h')
-rw-r--r--src/parsing.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/parsing.h b/src/parsing.h
index 908fbe084..12029d290 100644
--- a/src/parsing.h
+++ b/src/parsing.h
@@ -250,11 +250,17 @@ struct UniqueNameMapper {
}
Name sourceToUnique(Name sName) {
- return labelMappings.at(sName).back();
+ if (labelMappings.find(sName) == labelMappings.end()) {
+ throw ParseException("label mismatch in sourceToUnique");
+ }
+ return labelMappings[sName].back();
}
Name uniqueToSource(Name name) {
- return reverseLabelMapping.at(name);
+ if (reverseLabelMapping.find(name) == reverseLabelMapping.end()) {
+ throw ParseException("label mismatch in uniqueToSource");
+ }
+ return reverseLabelMapping[name];
}
void clear() {