mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Perform more thorough checking of t2IT mask parameters, which fixes all remaining crashers when disassembling the entire 16-bit instruction space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -20,6 +20,7 @@ def it_pred : Operand<i32> {
|
|||||||
// IT block condition mask
|
// IT block condition mask
|
||||||
def it_mask : Operand<i32> {
|
def it_mask : Operand<i32> {
|
||||||
let PrintMethod = "printThumbITMask";
|
let PrintMethod = "printThumbITMask";
|
||||||
|
let DecoderMethod = "DecodeITMask";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shifted operands. No register controlled shifts for Thumb2.
|
// Shifted operands. No register controlled shifts for Thumb2.
|
||||||
|
@ -230,6 +230,8 @@ static DecodeStatus DecodeThumbBLTargetOperand(llvm::MCInst &Inst, unsigned Val,
|
|||||||
uint64_t Address, const void *Decoder);
|
uint64_t Address, const void *Decoder);
|
||||||
static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Val,
|
static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Val,
|
||||||
uint64_t Address, const void *Decoder);
|
uint64_t Address, const void *Decoder);
|
||||||
|
static DecodeStatus DecodeITMask(llvm::MCInst &Inst, unsigned Val,
|
||||||
|
uint64_t Address, const void *Decoder);
|
||||||
|
|
||||||
#include "ARMGenDisassemblerTables.inc"
|
#include "ARMGenDisassemblerTables.inc"
|
||||||
#include "ARMGenInstrInfo.inc"
|
#include "ARMGenInstrInfo.inc"
|
||||||
@ -3304,3 +3306,14 @@ static DecodeStatus DecodeITCond(llvm::MCInst &Inst, unsigned Cond,
|
|||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DecodeStatus DecodeITMask(llvm::MCInst &Inst, unsigned Mask,
|
||||||
|
uint64_t Address, const void *Decoder) {
|
||||||
|
DecodeStatus S = Success;
|
||||||
|
if (Mask == 0) {
|
||||||
|
Mask = 0x8;
|
||||||
|
CHECK(S, Unpredictable);
|
||||||
|
}
|
||||||
|
Inst.addOperand(MCOperand::CreateImm(Mask));
|
||||||
|
return S;
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user