aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-07 21:52:18 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-07 21:52:18 +0000
commit63b57aeeebb5bb758ecebf9b41b5131781f32bf3 (patch)
tree7793ff6d3149690c06419a15ee9e49400e0a15ef /lib/Sema/SemaChecking.cpp
parente6012c7ecb9d848f4091c8c48e7d9946cc36b23f (diff)
Fix an infinite loop, caused by unintended syntax bug (the 'break;' after 'default:' was intended to break out of the while loop).
Fixes rdar://8518859&8520617. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index e79b639229..ae2fef21c4 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -2454,14 +2454,10 @@ static bool IsZero(Sema &S, Expr *E) {
static bool HasEnumType(Expr *E) {
// Strip off implicit integral promotions.
while (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
- switch (ICE->getCastKind()) {
- case CK_IntegralCast:
- case CK_NoOp:
- E = ICE->getSubExpr();
- continue;
- default:
+ if (ICE->getCastKind() != CK_IntegralCast &&
+ ICE->getCastKind() != CK_NoOp)
break;
- }
+ E = ICE->getSubExpr();
}
return E->getType()->isEnumeralType();