From 899b68fdf5536ba6b45941dd385d96dda563a4d1 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 23 Mar 2011 15:13:44 +0000 Subject: Teach DelayedDiagnostic to copy its string, rather than hope that the string itself lives longer than the DelayedDiagnostic. Fixes a recent use-after-free regression due to my availability attribute work. llvm-svn: 128148 --- clang/lib/Sema/SemaDeclAttr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaDeclAttr.cpp') diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 31523229c59..81bf230f942 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3095,7 +3095,7 @@ void Sema::DelayedDiagnostics::popParsingDecl(Sema &S, ParsingDeclState state, // Destroy all the delayed diagnostics we're about to pop off. for (unsigned i = state.SavedStackSize, e = DD.StackSize; i != e; ++i) - DD.Stack[i].destroy(); + DD.Stack[i].Destroy(); DD.StackSize = state.SavedStackSize; } -- cgit v1.2.3