mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 19:56:06 +00:00
Fixed undefined behavior in pushMappings when the stack has to resize.
llvm-svn: 84924
This commit is contained in:
parent
9bb0059449
commit
d73d7add37
@ -230,6 +230,8 @@ Diagnostic::~Diagnostic() {
|
||||
|
||||
|
||||
void Diagnostic::pushMappings() {
|
||||
// Avoids undefined behavior when the stack has to resize.
|
||||
DiagMappingsStack.reserve(DiagMappingsStack.size() + 1);
|
||||
DiagMappingsStack.push_back(DiagMappingsStack.back());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user