[PATCH] D48953: [COFF] Store import symbol pointers as pointers to the base class

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 14:13:54 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: ruiu, pcc.

Future symbol insertions can potentially change the type of these symbols - keep pointers to the base class to reflect this, and use dynamic casts to inspect them before using as the subclass type.

This fixes crashes that were possible before, by touching these symbols that now are populated as e.g. a DefinedRegular, via the old pointers with DefinedImportThunk type.

Alternatively, just disallow the replacements of these symbols (implemented in https://reviews.llvm.org/D48952).


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D48953

Files:
  COFF/InputFiles.cpp
  COFF/InputFiles.h
  COFF/SymbolTable.cpp
  COFF/SymbolTable.h
  COFF/Writer.cpp
  test/COFF/Inputs/otherFunc.s
  test/COFF/thunk-replace.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48953.154151.patch
Type: text/x-patch
Size: 5177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180704/fa6fdfac/attachment.bin>


More information about the llvm-commits mailing list