зеркало из https://github.com/microsoft/clang-1.git
Fixed undefined behavior in pushMappings when the stack has to resize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84924 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
386378de86
Коммит
ca2c3e2cfc
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче