From 4c7d9494d45cf4aa46a89fac285492d1b94d5ad7 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 14 Jan 2024 21:12:26 -0500 Subject: [PATCH] Fix unmanaged constructor name failure --- src/constructor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/constructor.cpp b/src/constructor.cpp index 7195867..8a615c2 100644 --- a/src/constructor.cpp +++ b/src/constructor.cpp @@ -21,7 +21,10 @@ bool Constructor::IsValid() std::string Constructor::GetName() { - return GetRootVirtualFunctionTable()->GetCOLocator()->GetTypeDescriptor().GetDemangledName(); + auto coLocator = GetRootVirtualFunctionTable()->GetCOLocator(); + if (!coLocator.has_value()) + return "Constructor_" + std::to_string(GetRootVirtualFunctionTable()->m_address); + return coLocator->GetTypeDescriptor().GetDemangledName(); } std::optional Constructor::GetRootVirtualFunctionTable()