Plug a leak in the arm disassembler and put the tests back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128238 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2011-03-24 21:14:28 +00:00
parent 505f3cd296
commit 83ccbff84f
3 changed files with 10 additions and 3 deletions

View File

@ -18,6 +18,7 @@
#include "ARMDisassembler.h"
#include "ARMDisassemblerCore.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/MC/EDInstInfo.h"
#include "llvm/MC/MCInst.h"
#include "llvm/Target/TargetRegistry.h"
@ -384,15 +385,13 @@ bool ARMDisassembler::getInstruction(MCInst &MI,
showBitVector(errs(), insn);
});
ARMBasicMCBuilder *Builder = CreateMCBuilder(Opcode, Format);
OwningPtr<ARMBasicMCBuilder> Builder(CreateMCBuilder(Opcode, Format));
if (!Builder)
return false;
if (!Builder->Build(MI, insn))
return false;
delete Builder;
return true;
}

View File

@ -0,0 +1,4 @@
# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
# invalid (imod, M, iflags) combination
0x93 0x1c 0x02 0xf1

View File

@ -0,0 +1,4 @@
# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
# core registers out of range
0xa5 0xba 0x52 0xed