]> granicus.if.org Git - clang/commitdiff
Squelch leak found by LSan by handling missing switch case.
authorJordan Rose <jordan_rose@apple.com>
Thu, 24 Apr 2014 17:27:18 +0000 (17:27 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 24 Apr 2014 17:27:18 +0000 (17:27 +0000)
Also, use the enum type in the switch so this doesn't happen again.

PR19523

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207128 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/DelayedDiagnostic.cpp

index 533b7ef3e87d0e3e0fd40537d4ba4575570eb849..ddecfdb3765be3193e9bd31b775b6444e713b28d 100644 (file)
@@ -52,12 +52,13 @@ DelayedDiagnostic::makeAvailability(Sema::AvailabilityDiagnostic AD,
 }
 
 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;