Author: jrose
Date: Thu Apr 24 12:27:18 2014
New Revision: 207128
URL: http://llvm.org/viewvc/llvm-project?rev=207128&view=rev
Log:
Squelch leak found by LSan by handling missing switch case.
Also, use the enum type in the switch so this doesn't happen again.
PR19523
Modified:
cfe/trunk/lib/Sema/DelayedDiagnostic.cpp
Modified: cfe/trunk/lib/Sema/DelayedDiagnostic.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/DelayedDiagnostic.cpp?rev=207128&r1=207127&r2=207128&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/DelayedDiagnostic.cpp (original)
+++ cfe/trunk/lib/Sema/DelayedDiagnostic.cpp Thu Apr 24 12:27:18 2014
@@ -52,12 +52,13 @@ DelayedDiagnostic::makeAvailability(Sema
}
void DelayedDiagnostic::Destroy() {
- switch (Kind) {
+ switch (static_cast<DDKind>(Kind)) {
case Access:
getAccessData().~AccessedEntity();
break;
- case Deprecation:
+ case Deprecation:
+ case Unavailable:
delete [] DeprecationData.Message;
break;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits