diff options
author | Oliver Bruns <obruns@gmail.com> | 2020-04-06 10:38:30 +0200 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2020-05-18 21:07:01 -0700 |
commit | 4b2f37b2202ebb5c6c05cf00026f506c52a62909 (patch) | |
tree | 12f9ef5813db77064e032510e9e1edcd8477bf15 /lldb/packages/Python/lldbsuite/test/commands/expression/context-object-objc | |
parent | d9160ff3e92683be70a80b60f4139836316bd63e (diff) | |
download | bcm5719-llvm-4b2f37b2202ebb5c6c05cf00026f506c52a62909.tar.gz bcm5719-llvm-4b2f37b2202ebb5c6c05cf00026f506c52a62909.zip |
[clang] fix undefined behaviour in RawComment::getFormattedText()
Summary:
Calling `back()` and `pop_back()` on the empty string is undefined
behavior [1,2].
The issue manifested itself as an uncaught `std::out_of_range` exception
when running `clangd` compiled on RHEL7 using devtoolset-9.
[1] https://en.cppreference.com/w/cpp/string/basic_string/back
[2] https://en.cppreference.com/w/cpp/string/basic_string/pop_back
Fixes: 1ff7c32fc91c607b690d4bb9cf42f406be8dde68
Reviewers: teemperor, ioeric, cfe-commits
Reviewed By: teemperor
Subscribers: ilya-biryukov, kadircet, usaxena95
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77468
(cherry picked from commit ad7211df6f257e39da2e5a11b2456b4488f32a1e)
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/commands/expression/context-object-objc')
0 files changed, 0 insertions, 0 deletions