From fc8431d320f5c9523e3e47d86d6068b6e134775e Mon Sep 17 00:00:00 2001 From: Isaac Ault Date: Tue, 21 Jan 2025 11:40:44 +1000 Subject: [PATCH] Feedback: Change from unreachable to abort. --- source/common/ur_singleton.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/common/ur_singleton.hpp b/source/common/ur_singleton.hpp index d2146005fb..30471d0a53 100644 --- a/source/common/ur_singleton.hpp +++ b/source/common/ur_singleton.hpp @@ -17,6 +17,8 @@ #include #include +#include "logger/ur_logger.hpp" + ////////////////////////////////////////////////////////////////////////// /// a abstract factory for creation of singleton objects template class singleton_factory_t { @@ -79,7 +81,8 @@ template class singleton_factory_t { if (auto iter = map.find(getKey(key)); iter != map.end()) { iter->second.ref_count++; } else { - __builtin_unreachable(); + logger::error("Invalid singleton key. Aborting."); + std::abort(); } } @@ -94,7 +97,8 @@ template class singleton_factory_t { iter->second.ref_count--; } } else { - __builtin_unreachable(); + logger::error("Invalid singleton key. Aborting."); + std::abort(); } }