[ORC-RT][llvm-jitlink] Fix a buggy check in ORC-RT MachO TLV deregistration.
The check was failing because it was matching against the end of the range, not
the start.
This bug wasn't causing the ORC-RT MachO TLV regression test to fail because
we were only logging deallocation errors (including TLV deregistration errors)
and not actually returning a failure code. This commit updates llvm-jitlink to
report the errors properly.
GitOrigin-RevId: 3fb641618f1a3b73c0bd661c567e8db32dcde491
diff --git a/lib/orc/macho_platform.cpp b/lib/orc/macho_platform.cpp
index b36f9df..d8f9d5b 100644
--- a/lib/orc/macho_platform.cpp
+++ b/lib/orc/macho_platform.cpp
@@ -308,7 +308,7 @@
Error MachOPlatformRuntimeState::deregisterThreadDataSection(
span<const char> ThreadDataSection) {
std::lock_guard<std::mutex> Lock(ThreadDataSectionsMutex);
- auto I = ThreadDataSections.find(ThreadDataSection.end());
+ auto I = ThreadDataSections.find(ThreadDataSection.data());
if (I == ThreadDataSections.end())
return make_error<StringError>("Attempt to deregister unknown thread data "
"section");