aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-04-16 23:02:25 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-04-16 23:02:25 +0000
commitaf5b0e851e42d7de1247c4084ba75a76c4497ca6 (patch)
treef638b587714573d95d2e604276e0f0d1b83309c9
parenta3dfc646b4d772979f8994c07eeee6af57480d34 (diff)
downloadexternal_llvm-af5b0e851e42d7de1247c4084ba75a76c4497ca6.zip
external_llvm-af5b0e851e42d7de1247c4084ba75a76c4497ca6.tar.gz
external_llvm-af5b0e851e42d7de1247c4084ba75a76c4497ca6.tar.bz2
Fixed logic error. Should check Builder for validity before calling SetSession
on it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101563 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/Disassembler/ARMDisassembler.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index 81fb085..0e27e16 100644
--- a/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -407,7 +407,6 @@ bool ARMDisassembler::getInstruction(MCInst &MI,
});
ARMBasicMCBuilder *Builder = CreateMCBuilder(Opcode, Format);
-
if (!Builder)
return false;
@@ -495,11 +494,11 @@ bool ThumbDisassembler::getInstruction(MCInst &MI,
});
ARMBasicMCBuilder *Builder = CreateMCBuilder(Opcode, Format);
- Builder->SetSession(const_cast<Session *>(&SO));
-
if (!Builder)
return false;
+ Builder->SetSession(const_cast<Session *>(&SO));
+
if (!Builder->Build(MI, insn))
return false;