]> granicus.if.org Git - clang/commitdiff
fix infinite recursion
authorChris Lattner <sabre@nondot.org>
Wed, 4 Mar 2009 04:30:02 +0000 (04:30 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Mar 2009 04:30:02 +0000 (04:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66014 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Stmt.h

index ea6060360676fba46bd9e412d73c275a36ba4bbd..465b26ff2385035306b291ec03b40f85e7b84381 100644 (file)
@@ -471,7 +471,7 @@ public:
   virtual SourceRange getSourceRange() const {
     // Handle deeply nested case statements with iteration instead of recursion.
     const CaseStmt *CS = this;
-    while (const CaseStmt *CS2 = dyn_cast<CaseStmt>(getSubStmt()))
+    while (const CaseStmt *CS2 = dyn_cast<CaseStmt>(CS->getSubStmt()))
       CS = CS2;
     
     return SourceRange(CaseLoc, CS->getSubStmt()->getLocEnd());