summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
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);
}