summaryrefslogtreecommitdiff
path: root/objectivec/objc.cpp
diff options
context:
space:
mode:
authorMark Rowe <mrowe@bdash.net.nz>2025-05-08 10:34:13 -0700
committerkat <kat@vector35.com>2025-06-03 14:44:06 -0400
commit8ef932b35e76f670611b79a2fcba88c6f8e15169 (patch)
treed890a3e7a4d9ccea560dfa2937f7639b5d1cc0ef /objectivec/objc.cpp
parent4bc31537add776f79cff0847feb4ccb8f0c43d22 (diff)
[ObjC] Add an explicit reference to a method impl from its selector
This makes it easier to see the possible message send targets when looking at a call to `objc_msgSend`.
Diffstat (limited to 'objectivec/objc.cpp')
-rw-r--r--objectivec/objc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/objectivec/objc.cpp b/objectivec/objc.cpp
index a57f2c73..014d8057 100644
--- a/objectivec/objc.cpp
+++ b/objectivec/objc.cpp
@@ -955,6 +955,7 @@ void ObjCProcessor::ReadMethodList(ObjCReader* reader, ClassBase& cls, std::stri
DefineObjCSymbol(DataSymbol, Type::PointerType(m_data->GetAddressSize(), selType),
"selRef_" + method.name, meth.name, true);
}
+
// workflow objc support
if (selAddr)
m_selToImplementations[selAddr].push_back(meth.imp);
@@ -967,6 +968,11 @@ void ObjCProcessor::ReadMethodList(ObjCReader* reader, ClassBase& cls, std::stri
method.imp = meth.imp;
cls.methodList[cursor] = method;
m_localMethods[cursor] = method;
+
+ if (selAddr)
+ m_data->AddUserDataReference(selAddr, meth.imp);
+ if (selRefAddr)
+ m_data->AddUserDataReference(selRefAddr, meth.imp);
}
catch (...)
{