Skip to content

Commit

Permalink
Fix ADR instruction encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kkHAIKE committed Oct 15, 2022
1 parent 1856935 commit 543c670
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ AArch64MCCodeEmitter::getAdrLabelOpValue(const MCInst &MI, unsigned OpIdx,

// If the destination is an immediate, we have nothing to do.
if (MO.isImm())
return MO.getImm() - (MI.getAddress() >> 12);
return MO.getImm() - (MI.getAddress() >> (MI.getOpcode() == AArch64::ADR ? 0 : 12));
assert(MO.isExpr() && "Unexpected target type!");
const MCExpr *Expr = MO.getExpr();

Expand Down

0 comments on commit 543c670

Please sign in to comment.