From 8c781bfd8ac21ede0f69f8772baff7111a588067 Mon Sep 17 00:00:00 2001 From: Peter Ferenc Hajdu Date: Thu, 30 Oct 2014 16:49:02 +0100 Subject: [PATCH] assert if name demangling fails --- sol/demangle.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sol/demangle.hpp b/sol/demangle.hpp index 78f4dd4..c4538aa 100644 --- a/sol/demangle.hpp +++ b/sol/demangle.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #if defined(__GNUC__) || defined(__clang__) #include @@ -41,6 +42,7 @@ inline std::string get_type_name(const std::type_info& id) { inline std::string get_type_name(const std::type_info& id) { int status; char* unmangled = abi::__cxa_demangle(id.name(), 0, 0, &status); + assert(0==status); std::string realname = unmangled; std::free(unmangled); return realname;