[llvm] r340287 - [aarch64][mc] Don't lookup symbols when there is no symbol lookup callback

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 08:47:25 PDT 2018


Author: dsanders
Date: Tue Aug 21 08:47:25 2018
New Revision: 340287

URL: http://llvm.org/viewvc/llvm-project?rev=340287&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp

Modified: llvm/trunk/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp?rev=340287&r1=340286&r2=340287&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp Tue Aug 21 08:47:25 2018
@@ -60,6 +60,8 @@ getVariant(uint64_t LLVMDisassembler_Var
 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




More information about the llvm-commits mailing list