summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-07-26 08:11:57 +0000
committerPavel Labath <labath@google.com>2016-07-26 08:11:57 +0000
commitf7e7fdd5cfebf4a8a30e4b4dce410a237f13a17c (patch)
tree292207befa0aff5545df77cd99b19009691ab0d2 /libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd
parent79011a660eda556f553fe52f090cb4156f12c1ab (diff)
downloadbcm5719-llvm-f7e7fdd5cfebf4a8a30e4b4dce410a237f13a17c.tar.gz
bcm5719-llvm-f7e7fdd5cfebf4a8a30e4b4dce410a237f13a17c.zip
Fix DataExtractor::PeekData for zero length peeks
Summary: The function was returning the null pointer for peeks of size zero, which seems like a sensible thing to do, but is actually pretty easy to get bitten by that if you are extracting a variable length field which happens to be of zero length and then doing pointer arithmetic on that (which SymbolFileDWARF does, and ended up crashing in case of empty DW_AT_location). This changes the function to return a null pointer only when it gets queried for data which is outside of the range of the extractor, which is more c++-y, as one can still do reasonable things with pointers to data of size zero (think, end() iterators). I also add a test and fix some signedness warnings in the existing data extractor tests. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D22755 llvm-svn: 276734
Diffstat (limited to 'libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud