diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-08-12 21:49:29 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-08-12 21:49:29 +0100 |
| commit | 7a36a4644ef72fc85ff8bec690a7e83205f2b8ad (patch) | |
| tree | a972611e0a847e156fdc7ee74b5261e1d5cd9d04 | |
| parent | e7e414c46d35a21adc37aeffe294a0593f40293c (diff) | |
Detect face being aliased to itself
Fixes #374
| -rw-r--r-- | src/face_registry.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/face_registry.cc b/src/face_registry.cc index cbbd32ed..5e42452d 100644 --- a/src/face_registry.cc +++ b/src/face_registry.cc @@ -58,6 +58,9 @@ void FaceRegistry::register_alias(const String& name, const String& facedesc, [](char c){ return not isalnum(c); })) throw runtime_error(format("invalid alias name: '{}'", name)); + if (name == facedesc) + throw runtime_error(format("cannot alias face '{}' to itself", name)); + FaceOrAlias& alias = m_aliases[name]; auto it = m_aliases.find(facedesc); if (it != m_aliases.end()) |
