summaryrefslogtreecommitdiff
path: root/view/elf/elfview.cpp
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2025-06-24 17:55:48 -0400
committerAlexander Taylor <alex@vector35.com>2025-06-25 18:36:47 -0400
commitc41f264a1dba68c89b4a224a70e3a5783f7fa879 (patch)
tree00bb6e91d86b708bff7265ed7179a6ef2793b7fb /view/elf/elfview.cpp
parentb1a7666164a000c5255f90568ed9597b58ce276a (diff)
Remove implicit conversions from Confidence to underlying type, these can cause bugs and also issues with C++20
Diffstat (limited to 'view/elf/elfview.cpp')
-rw-r--r--view/elf/elfview.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp
index d8a0a112..b8dd1aaa 100644
--- a/view/elf/elfview.cpp
+++ b/view/elf/elfview.cpp
@@ -2396,7 +2396,8 @@ bool ElfView::Init()
);
/* create type, associate it with RTL_Resolve */
- Ref<Type> ptr_type = Type::PointerType(m_arch, Type::VoidType())->WithConfidence(BN_FULL_CONFIDENCE);
+ Confidence<Ref<Type>> ptr_type =
+ Type::PointerType(m_arch, Type::VoidType())->WithConfidence(BN_FULL_CONFIDENCE);
Ref<CallingConvention> cc = m_arch->GetCallingConventionByName("linux-rtlresolve");
@@ -2452,20 +2453,20 @@ bool ElfView::Init()
void ElfView::DefineElfSymbol(BNSymbolType type, const string& incomingName, uint64_t addr, bool gotEntry,
- BNSymbolBinding binding, size_t size, Ref<Type> typeObj)
+ BNSymbolBinding binding, size_t size, const Confidence<Ref<Type>>& typeObj)
{
// Ensure symbol is within the executable
if (type != ExternalSymbol && !IsValidOffset(addr))
return;
string name = incomingName;
- Ref<Type> symbolTypeRef;
+ Confidence<Ref<Type>> symbolTypeRef;
if ((type == ExternalSymbol) || (type == ImportAddressSymbol) || (type == ImportedDataSymbol))
{
QualifiedName n(name);
Ref<TypeLibrary> lib = nullptr;
symbolTypeRef = ImportTypeLibraryObject(lib, n);
- if (symbolTypeRef)
+ if (symbolTypeRef.GetValue())
{
m_logger->LogDebug("elf: type Library '%s' found hit for '%s'", lib->GetName().c_str(), name.c_str());
if (type != ExternalSymbol || addr != 0)