1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test
Adrian Prantl 354f803ed7 Fix computeSymbolSizes SEGFAULT on invalid file
We use llvm-symbolizer in some production systems, and we run it
against all possibly related files, including some that are not
ELF. We noticed that for some of those invalid files, llvm-symbolizer
would crash with SEGFAULT. Here is an example of such a file.

It is due to that in computeSymbolSizes, a loop uses condition

  for (unsigned I = 0, N = Addresses.size() - 1; I < N; ++I) {

where if Addresses.size() is 0, N would overflow and causing the loop
to access invalid memory.

Instead of patching the loop conditions, the commit makes so that the
function returns early if Addresses is empty.

Validated by checking that llvm-symbolizer no longer crashes.

Patch by Teng Qin!

Differential Revision: https://reviews.llvm.org/D44285

llvm-svn: 330610
2018-04-23 16:08:01 +00:00
..
Analysis [CostModel][X86] Add vector element insert/extract cost tests 2018-04-20 15:26:59 +00:00
Assembler
Bindings [LLVM-C] DIBuilderBindings for Subrange and Arrays 2018-04-23 14:29:33 +00:00
Bitcode [bcanalyzer] Recognize more stream types 2018-04-21 23:52:04 +00:00
BugPoint
CodeGen AMDGPU: Fix a corner case crash in SIOptimizeExecMasking 2018-04-23 13:05:50 +00:00
DebugInfo [DEBUGINFO, NVPTX] Add the test for the debug info of the local 2018-04-23 14:00:53 +00:00
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation [HWASan] Introduce non-zero based and dynamic shadow memory (LLVM). 2018-04-20 20:04:04 +00:00
Integer
JitListener
Linker [llvm-link] Use WithColor for printing errors 2018-04-18 14:41:47 +00:00
LTO
MC [AArch64][SVE] Asm: Support for contiguous, non-faulting LDNF1 (scalar+imm) load instructions 2018-04-23 12:43:19 +00:00
Object
ObjectYAML
Other
SafepointIRVerifier
SymbolRewriter
TableGen
ThinLTO/X86
tools Fix computeSymbolSizes SEGFAULT on invalid file 2018-04-23 16:08:01 +00:00
Transforms [LoopRotate] Fix incorrect SCEV invalidation in loop rotation 2018-04-23 12:33:31 +00:00
Unit
Verifier
YAMLParser
.clang-format
CMakeLists.txt Sort a target list a bit better. 2018-04-23 14:28:49 +00:00
lit.cfg.py
lit.site.cfg.py.in
TestRunner.sh