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 --- binaryview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'binaryview.cpp') diff --git a/binaryview.cpp b/binaryview.cpp index 541c6ca9..13e9f439 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -1641,7 +1641,7 @@ bool BinaryView::GetDataVariableAtAddress(uint64_t addr, DataVariable& var) return false; var.address = result.address; - var.type = Confidence>(new Type(result.type), result.typeConfidence); + var.type = Confidence>(new Type(BNNewTypeReference(result.type)), result.typeConfidence); var.autoDiscovered = result.autoDiscovered; return true; } @@ -2167,7 +2167,7 @@ std::map>>> BinaryView::GetAllTypesRe for (size_t j = 0; j < fields[i].count; j++) { BNTypeWithConfidence tc = fields[i].types[j]; - Ref type = tc.type ? new Type(tc.type) : nullptr; + Ref type = tc.type ? new Type(BNNewTypeReference(tc.type)) : nullptr; types.push_back(Confidence>(type, tc.confidence)); } } @@ -2204,7 +2204,7 @@ std::vector>> BinaryView::GetTypesReferenced(const Qualifie for (size_t i = 0; i < count; i++) { BNTypeWithConfidence tc = types[i]; - Ref type = tc.type ? new Type(tc.type) : nullptr; + Ref type = tc.type ? new Type(BNNewTypeReference(tc.type)) : nullptr; result.push_back(Confidence>(type, tc.confidence)); } @@ -3119,7 +3119,7 @@ Ref BinaryView::GetTypeById(const string& id) BNType* type = BNGetAnalysisTypeById(m_object, id.c_str()); if (!type) return nullptr; - return new Type(type); + return new Type(BNNewTypeReference(type)); } @@ -3764,7 +3764,7 @@ Confidence> BinaryView::CreateStructureMemberFromAccess(const Qualifie BNTypeWithConfidence type = BNCreateStructureMemberFromAccess(m_object, &typeObj, offset); if (type.type) - return Confidence>(new Type(type.type), type.confidence); + return Confidence>(new Type(BNNewTypeReference(type.type)), type.confidence); return nullptr; } -- cgit v1.3.1