aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAdam Czachorowski <adamcz@google.com>2021-06-01 18:24:33 +0200
committerAdam Czachorowski <adamcz@google.com>2021-06-07 13:29:58 +0200
commit721476e6b2119a93033903109b54f429b6e8c91b (patch)
tree4e28823197d23a28fd1bdabb376cffd2834b5bba /flang/lib/Frontend/CompilerInvocation.cpp
parent8b58092de49b8be964e760c161585665e8d8c48f (diff)
downloadllvm-721476e6b2119a93033903109b54f429b6e8c91b.zip
llvm-721476e6b2119a93033903109b54f429b6e8c91b.tar.gz
llvm-721476e6b2119a93033903109b54f429b6e8c91b.tar.bz2
[clang] Fix a crash during code completion
During code completion, lookupInDeclContext() calls CodeCompletionDeclConsumer::FoundDecl(),which can mutate StoredDeclsMap, over which lookupInDeclContext() iterates. This can lead to invalidation of iterators and an assert()-crash. Example code where this happens: #include <list> int main() { std::list<int>; std::^ } with code completion on ^ with -std=c++20. I do not have a repro case that does not need standard library. This fix stores pointers to NamedDecls in a temporary vector, then visits them outside of the main loop, when StoredDeclsMap iterators are gone. Differential Revision: https://reviews.llvm.org/D103472
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions