From 5646f03f9a61feb24584a8a5da94027783b16e5a Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Fri, 18 Mar 2022 12:35:46 -0400 Subject: Fix a bunch of reference miscounts in the C++ and python apis --- function.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index 712c8155..eb9907af 100644 --- a/function.cpp +++ b/function.cpp @@ -767,7 +767,7 @@ Ref Function::GetType() const Confidence> Function::GetReturnType() const { BNTypeWithConfidence tc = BNGetFunctionReturnType(m_object); - Ref type = tc.type ? new Type(tc.type) : nullptr; + Ref type = tc.type ? new Type(BNNewTypeReference(tc.type)) : nullptr; return Confidence>(type, tc.confidence); } @@ -1456,7 +1456,7 @@ Confidence> Function::GetVariableType(const Variable& var) BNTypeWithConfidence type = BNGetVariableType(m_object, &var); if (!type.type) return nullptr; - return Confidence>(new Type(type.type), type.confidence); + return Confidence>(new Type(BNNewTypeReference(type.type)), type.confidence); } @@ -1643,7 +1643,7 @@ void Function::SetUserCallRegisterStackAdjustment( Confidence> Function::GetCallTypeAdjustment(Architecture* arch, uint64_t addr) { BNTypeWithConfidence result = BNGetCallTypeAdjustment(m_object, arch->GetObject(), addr); - return Confidence>(result.type ? new Type(result.type) : nullptr, result.confidence); + return Confidence>(result.type ? new Type(BNNewTypeReference(result.type)) : nullptr, result.confidence); } -- cgit v1.3.1