aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
index f427271bb45d..7a71d2f781d7 100644
--- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp
@@ -410,7 +410,7 @@ Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym,
while (I < Content.size()) {
MCInst Instr;
uint64_t InstrSize = 0;
- uint64_t InstrStart = SymAddress + I;
+ uint64_t InstrStart = SymAddress.getValue() + I;
auto DecodeStatus = Disassembler.getInstruction(
Instr, InstrSize, Content.drop_front(I), InstrStart, CommentStream);
if (DecodeStatus != MCDisassembler::Success) {
@@ -426,7 +426,7 @@ Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym,
// Check for a PC-relative address equal to the symbol itself.
auto PCRelAddr =
MIA.evaluateMemoryOperandAddress(Instr, &STI, InstrStart, InstrSize);
- if (!PCRelAddr.hasValue() || PCRelAddr.getValue() != SymAddress)
+ if (!PCRelAddr || *PCRelAddr != SymAddress.getValue())
continue;
auto RelocOffInInstr =
@@ -438,8 +438,8 @@ Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym,
continue;
}
- auto RelocOffInBlock =
- InstrStart + *RelocOffInInstr - SymAddress + Sym.getOffset();
+ auto RelocOffInBlock = orc::ExecutorAddr(InstrStart) + *RelocOffInInstr -
+ SymAddress + Sym.getOffset();
if (ExistingRelocations.contains(RelocOffInBlock))
continue;