diff options
author | Ivan Murashko <ivanmurashko@fb.com> | 2022-08-12 00:04:23 +0100 |
---|---|---|
committer | Ivan Murashko <ivan.murashko@gmail.com> | 2022-08-12 00:05:59 +0100 |
commit | 557e32e002edd2a5a9e728d96b098bffa33e34d0 (patch) | |
tree | a121cb90b9e25ef06bf23f17e4c00f38a426d954 /lldb/packages/Python/lldbsuite/test/configuration.py | |
parent | 3486b1b7362eb30c70aa913a06933dad632f7964 (diff) | |
download | llvm-557e32e002edd2a5a9e728d96b098bffa33e34d0.zip llvm-557e32e002edd2a5a9e728d96b098bffa33e34d0.tar.gz llvm-557e32e002edd2a5a9e728d96b098bffa33e34d0.tar.bz2 |
[clang] SIGSEGV fix at clang::ASTContext::getRawCommentForDeclNoCacheImpl
The `File` might point to an invalid `FileID` when the AST is broken. That leads to clang/clangd crashes while processing comments. The relevant part of the crash is below
```
#4 0x00007f1d7fbf95bc std::_Rb_tree<unsigned int, std::pair<unsigned int const, clang::RawComment*>, std::_Select1st<std::pair<unsigned int const, clang::RawComment*>>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const
, clang::RawComment*>>>::_M_lower_bound(std::_Rb_tree_node<std::pair<unsigned int const, clang::RawComment*>> const*, std::_Rb_tree_node_base const*, unsigned int const&) const /usr/include/c++/8/bits/stl_tree.h:1911:2
#5 0x00007f1d7fbf95bc std::_Rb_tree<unsigned int, std::pair<unsigned int const, clang::RawComment*>, std::_Select1st<std::pair<unsigned int const, clang::RawComment*>>, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, clang::RawComment*>>>::lower_bound(unsigned int const&) const /usr/include/c++/8/bits/stl_tree.h:1214:56
#6 0x00007f1d7fbf95bc std::map<unsigned int, clang::RawComment*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, clang::RawComment*>>>::lower_bound(unsigned int const&) const /usr/include/c++/8/bits/stl_map.h:1264:36
#7 0x00007f1d7fbf95bc clang::ASTContext::getRawCommentForDeclNoCacheImpl(clang::Decl const*, clang::SourceLocation, std::map<unsigned int, clang::RawComment*, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, clang::RawComment*>>> const&) const /home/ivanmurashko/local/llvm-project/clang/lib/AST/ASTContext.cpp:226:57
```
The corresponding LIT test that reproduces the crash was also added
Same issue is described at https://bugs.llvm.org/show_bug.cgi?id=49707
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D131675
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py')
0 files changed, 0 insertions, 0 deletions