From 7a36a4644ef72fc85ff8bec690a7e83205f2b8ad Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 12 Aug 2015 21:49:29 +0100 Subject: [PATCH] Detect face being aliased to itself Fixes #374 --- src/face_registry.cc | 3 +++ 1 file changed, 3 insertions(+) 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())