summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2022-03-18 12:35:46 -0400
committerPeter LaFosse <peter@vector35.com>2022-03-23 14:52:09 -0400
commit5646f03f9a61feb24584a8a5da94027783b16e5a (patch)
tree662104a1ddcc47cfd9c6717e90a5f56c137a1f2e /function.cpp
parent33bddd0c8ad5c45a07c56caa964dd42631cd169c (diff)
Fix a bunch of reference miscounts in the C++ and python apis
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/function.cpp b/function.cpp
index 712c8155..eb9907af 100644
--- a/function.cpp
+++ b/function.cpp
@@ -767,7 +767,7 @@ Ref<Type> Function::GetType() const
Confidence<Ref<Type>> Function::GetReturnType() const
{
BNTypeWithConfidence tc = BNGetFunctionReturnType(m_object);
- Ref<Type> type = tc.type ? new Type(tc.type) : nullptr;
+ Ref<Type> type = tc.type ? new Type(BNNewTypeReference(tc.type)) : nullptr;
return Confidence<Ref<Type>>(type, tc.confidence);
}
@@ -1456,7 +1456,7 @@ Confidence<Ref<Type>> Function::GetVariableType(const Variable& var)
BNTypeWithConfidence type = BNGetVariableType(m_object, &var);
if (!type.type)
return nullptr;
- return Confidence<Ref<Type>>(new Type(type.type), type.confidence);
+ return Confidence<Ref<Type>>(new Type(BNNewTypeReference(type.type)), type.confidence);
}
@@ -1643,7 +1643,7 @@ void Function::SetUserCallRegisterStackAdjustment(
Confidence<Ref<Type>> Function::GetCallTypeAdjustment(Architecture* arch, uint64_t addr)
{
BNTypeWithConfidence result = BNGetCallTypeAdjustment(m_object, arch->GetObject(), addr);
- return Confidence<Ref<Type>>(result.type ? new Type(result.type) : nullptr, result.confidence);
+ return Confidence<Ref<Type>>(result.type ? new Type(BNNewTypeReference(result.type)) : nullptr, result.confidence);
}