diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-08-20 02:56:48 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-08-20 02:56:48 +0000 |
commit | 1d4b218fa55239f2a7350f48be14090d2753c22c (patch) | |
tree | 772e82b97595b41cb3aba95c4e76b8f6de89c5fc | |
parent | 7fa0d93a3bbe290244f4f157078d9a0d6e87b44f (diff) |
If the body of for loop is empty, set its body to the continue target.
Otherwise we get a wrong CFG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79507 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/CFG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index c4406858e5..336faabdfb 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -925,7 +925,7 @@ CFGBlock* CFGBuilder::VisitForStmt(ForStmt* F) { CFGBlock* BodyBlock = addStmt(F->getBody()); if (!BodyBlock) - BodyBlock = EntryConditionBlock; // can happen for "for (...;...; ) ;" + BodyBlock = ContinueTargetBlock; // can happen for "for (...;...;...) ;" else if (Block && !FinishBlock(BodyBlock)) return 0; |