[llvm] 1389260 - [JITLink][MachO][arm64] Fix error-check order.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 8 16:57:39 PST 2024
Author: Lang Hames
Date: 2024-02-08T16:55:05-08:00
New Revision: 1389260805ec2ffb74a4fb311e7327c64d9b8f54
URL: https://github.com/llvm/llvm-project/commit/1389260805ec2ffb74a4fb311e7327c64d9b8f54
DIFF: https://github.com/llvm/llvm-project/commit/1389260805ec2ffb74a4fb311e7327c64d9b8f54.diff
LOG: [JITLink][MachO][arm64] Fix error-check order.
The error check should be performed after the iterator increment, not before
it. Thanks to @dcb314 for catching this!
Fixes github.com/apple/swift/issues/81119
Added:
Modified:
llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
index 809b2d51f05961..556031baaaed50 100644
--- a/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
@@ -312,10 +312,10 @@ class MachOLinkGraphBuilder_arm64 : public MachOLinkGraphBuilder {
Addend = SignExtend64(RI.r_symbolnum, 24);
+ ++RelItr;
if (RelItr == RelEnd)
return make_error<JITLinkError>("Unpaired Addend reloc at " +
formatv("{0:x16}", FixupAddress));
- ++RelItr;
RI = getRelocationInfo(RelItr);
MachORelocKind = getRelocationKind(RI);
More information about the llvm-commits
mailing list