diff options
author | Dean Michael Berris <dberris@google.com> | 2018-07-10 08:25:44 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-07-10 08:25:44 +0000 |
commit | 0dd4f9f22fdba48cd30d4546f67c9ac8de3f1372 (patch) | |
tree | 4a2172684cda45414f3f90e510def847e7ad9412 /llvm/test/Transforms/CodeExtractor | |
parent | d1bf9ef0c7926a64a202865a6b879190c9b4cf9c (diff) | |
download | bcm5719-llvm-0dd4f9f22fdba48cd30d4546f67c9ac8de3f1372.tar.gz bcm5719-llvm-0dd4f9f22fdba48cd30d4546f67c9ac8de3f1372.zip |
[XRay][compiler-rt] xray::Array Freelist and Iterator Updates
Summary:
We found a bug while working on a benchmark for the profiling mode which
manifests as a segmentation fault in the profiling handler's
implementation. This change adds unit tests which replicate the
issues in isolation.
We've tracked this down as a bug in the implementation of the Freelist
in the `xray::Array` type. This happens when we trim the array by a
number of elements, where we've been incorrectly assigning pointers for
the links in the freelist of chunk nodes. We've taken the chance to add
more debug-only assertions to the code path and allow us to verify these
assumptions in debug builds.
In the process, we also took the opportunity to use iterators to
implement both `front()` and `back()` which exposes a bug in the
iterator decrement operation. In particular, when we decrement past a
chunk size boundary, we end up moving too far back and reaching the
`SentinelChunk` prematurely.
This change unblocks us to allow for contributing the non-crashing
version of the benchmarks in the test-suite as well.
Reviewers: kpw
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D48653
llvm-svn: 336644
Diffstat (limited to 'llvm/test/Transforms/CodeExtractor')
0 files changed, 0 insertions, 0 deletions