[PATCH] D51005: [aarch64][mc] Don't lookup symbols when there is no symbol lookup callback

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 15:22:22 PDT 2018


dsanders created this revision.
dsanders added a reviewer: aemerson.
Herald added a reviewer: javed.absar.
Herald added a subscriber: kristof.beyls.

When run under llvm-mc-disassemble-fuzzer, there is no symbol lookup callback so tryAddingSymbolicOperand() must fail gracefully instead of crashing


Repository:
  rL LLVM

https://reviews.llvm.org/D51005

Files:
  lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp


Index: lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
===================================================================
--- lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
+++ lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
@@ -60,6 +60,8 @@
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51005.161582.patch
Type: text/x-patch
Size: 733 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180820/473a8828/attachment.bin>


More information about the llvm-commits mailing list