summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2018-08-21 15:47:25 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2018-08-21 15:47:25 +0000
commit6a943fb16a41852df0d840d5ce65c0497d46c93c (patch)
treec558d7a1488ddfd6744a0ddb5f930156c9bcbc69 /llvm/lib/Target
parentcd9f68ec058a0ef1e06672a8835d981099a51ccb (diff)
downloadbcm5719-llvm-6a943fb16a41852df0d840d5ce65c0497d46c93c.tar.gz
bcm5719-llvm-6a943fb16a41852df0d840d5ce65c0497d46c93c.zip
[aarch64][mc] Don't lookup symbols when there is no symbol lookup callback
Summary: When run under llvm-mc-disassemble-fuzzer, there is no symbol lookup callback so tryAddingSymbolicOperand() must fail gracefully instead of crashing Reviewers: aemerson, javed.absar Reviewed By: aemerson Subscribers: lhames, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D51005 llvm-svn: 340287
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp b/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
index 6e64fc9347b..4e9b75eeb4f 100644
--- a/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
+++ b/llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
@@ -60,6 +60,8 @@ getVariant(uint64_t LLVMDisassembler_VariantKind) {
bool AArch64ExternalSymbolizer::tryAddingSymbolicOperand(
MCInst &MI, raw_ostream &CommentStream, int64_t Value, uint64_t Address,
bool IsBranch, uint64_t Offset, uint64_t InstSize) {
+ if (!SymbolLookUp)
+ return false;
// FIXME: This method shares a lot of code with
// MCExternalSymbolizer::tryAddingSymbolicOperand. It may be possible
// refactor the MCExternalSymbolizer interface to allow more of this
OpenPOWER on IntegriCloud