[AArch64] Fix Test&Branch to relative location instructions.

Wasn't masking by the size of the offset encoding so negative values were killing the instruction
Missed commiting this in my integer gatherpipe PR.
Fixes crashing on AArch64.
This commit is contained in:
Ryan Houdek 2015-09-07 13:38:58 -05:00
parent 5585c5adc2
commit 2ad26ab3e9
1 changed files with 1 additions and 1 deletions

View File

@ -477,7 +477,7 @@ void ARM64XEmitter::EncodeTestBranchInst(u32 op, ARM64Reg Rt, u8 bits, const voi
Rt = DecodeReg(Rt);
Write32((b64Bit << 31) | (0x36 << 24) | (op << 24) | \
(bits << 19) | (distance << 5) | Rt);
(bits << 19) | (((u32)distance << 5) & 0x7FFE0) | Rt);
}
void ARM64XEmitter::EncodeUnconditionalBranchInst(u32 op, const void* ptr)