diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index 29504ec0..620941c9 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -463,7 +463,8 @@ namespace ngcore static void* tryUpcast(const std::type_info& ti, T* p) { try - { return GetArchiveRegister(Demangle(typeid(B1).name())).upcaster(ti, static_cast(dynamic_cast(p))); } + { return GetArchiveRegister(Demangle(typeid(B1).name())). + upcaster(ti, static_cast(dynamic_cast(p))); } catch(std::exception&) { return Caster::tryUpcast(ti, p); } } @@ -473,9 +474,14 @@ namespace ngcore if(typeid(B1) == ti) return dynamic_cast(static_cast(p)); try - { return GetArchiveRegister(Demangle(typeid(B1).name())).downcaster(ti, static_cast(dynamic_cast(static_cast(p)))); } + { + return dynamic_cast(static_cast(GetArchiveRegister(Demangle(typeid(B1).name())). + downcaster(ti, p))); + } catch(std::exception&) - { return Caster::tryDowncast(ti, p); } + { + return Caster::tryDowncast(ti, p); + } } }; };