summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 1a0f1550..6f0ca20a 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -101,6 +101,15 @@ namespace BinaryNinja {
return obj->GetObject();
}
+ // This is needed by code like
+ // bool operator==(const T* obj) const { return T::GetObject(m_obj) == T::GetObject(obj); }
+ static T* GetObject(const CoreRefCountObject* obj)
+ {
+ if (!obj)
+ return nullptr;
+ return obj->GetObject();
+ }
+
void AddRef()
{
if (m_object && (m_refs != 0))