summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2024-11-24 20:55:04 -0500
committerBrian Potchik <brian@vector35.com>2024-11-24 20:55:04 -0500
commit004afdfbb47d91346191ab63be1d5a5d625704d4 (patch)
treeea9066848ae85e10d42cce5f51535b28e8b4f4fd
parentceda25989f132764ffe0daca1e2694142ff2912f (diff)
Properly maintain selections in the tags list.
-rw-r--r--binaryninjaapi.h1
-rw-r--r--binaryview.cpp18
2 files changed, 19 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 762cd275..71b506e0 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -4281,6 +4281,7 @@ namespace BinaryNinja {
TagReference();
TagReference(const BNTagReference& ref);
+ bool EqualsByData(const TagReference& other) const;
bool operator==(const TagReference& other) const;
bool operator!=(const TagReference& other) const;
diff --git a/binaryview.cpp b/binaryview.cpp
index d88c4548..f0969e9f 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -950,6 +950,24 @@ TagReference::TagReference(const BNTagReference& ref)
}
+bool TagReference::EqualsByData(const TagReference& other) const
+{
+ if (refType != other.refType)
+ return false;
+ if (autoDefined != other.autoDefined)
+ return false;
+ if (addr != other.addr)
+ return false;
+ if (func != other.func)
+ return false;
+ if (arch != other.arch)
+ return false;
+ if (tag->GetData() != other.tag->GetData())
+ return false;
+ return true;
+}
+
+
bool TagReference::operator==(const TagReference& other) const
{
if (refType != other.refType)