Skip to content

Commit 3fb6416

Browse files
committed
[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.
1 parent 9d5e647 commit 3fb6416

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler-rt/lib/orc/macho_platform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ Error MachOPlatformRuntimeState::registerThreadDataSection(
308308
Error MachOPlatformRuntimeState::deregisterThreadDataSection(
309309
span<const char> ThreadDataSection) {
310310
std::lock_guard<std::mutex> Lock(ThreadDataSectionsMutex);
311-
auto I = ThreadDataSections.find(ThreadDataSection.end());
311+
auto I = ThreadDataSections.find(ThreadDataSection.data());
312312
if (I == ThreadDataSections.end())
313313
return make_error<StringError>("Attempt to deregister unknown thread data "
314314
"section");

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,7 @@ int main(int argc, char *argv[]) {
16431643
}
16441644

16451645
// Destroy the session.
1646+
ExitOnErr(S->ES.endSession());
16461647
S.reset();
16471648

16481649
// If the executing code set a test result override then use that.

0 commit comments

Comments
 (0)