Fixed undefined behavior in pushMappings when the stack has to resize.

llvm-svn: 84924
This commit is contained in:
John Thompson 2009-10-23 02:21:17 +00:00
parent 9bb0059449
commit d73d7add37

View File

@ -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());
}