Skip to content

Commit 1389260

Browse files
committed
[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/swiftlang/swift/issues/81119
1 parent 1d4fc38 commit 1389260

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ class MachOLinkGraphBuilder_arm64 : public MachOLinkGraphBuilder {
312312

313313
Addend = SignExtend64(RI.r_symbolnum, 24);
314314

315+
++RelItr;
315316
if (RelItr == RelEnd)
316317
return make_error<JITLinkError>("Unpaired Addend reloc at " +
317318
formatv("{0:x16}", FixupAddress));
318-
++RelItr;
319319
RI = getRelocationInfo(RelItr);
320320

321321
MachORelocKind = getRelocationKind(RI);

0 commit comments

Comments
 (0)