summaryrefslogtreecommitdiff
path: root/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-06 08:21:31 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-06 08:21:31 +0000
commit37f6c480c696a4a72c1701ee54624cc807aa80ba (patch)
tree06d57bb7679a2140aef96db7105a0bd5f16a4358 /lib/Parse/ParseStmt.cpp
parent2659aeb5e51fe27d24bbffad0d1851b39fed5e43 (diff)
Notes
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r--lib/Parse/ParseStmt.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index 758b662a2392d..f041d7dfd7907 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -550,6 +550,8 @@ Parser::OwningStmtResult Parser::ParseIfStatement() {
if (ParseParenExprOrCondition(CondExp))
return StmtError();
+ FullExprArg FullCondExp(Actions.FullExpr(CondExp));
+
// C99 6.8.4p3 - In C99, the body of the if statement is a scope, even if
// there is no compound stmt. C90 does not have this clause. We only do this
// if the body isn't a compound statement to avoid push/pop in common cases.
@@ -631,7 +633,7 @@ Parser::OwningStmtResult Parser::ParseIfStatement() {
if (ElseStmt.isInvalid())
ElseStmt = Actions.ActOnNullStmt(ElseStmtLoc);
- return Actions.ActOnIfStmt(IfLoc, Actions.FullExpr(CondExp), move(ThenStmt),
+ return Actions.ActOnIfStmt(IfLoc, FullCondExp, move(ThenStmt),
ElseLoc, move(ElseStmt));
}
@@ -752,6 +754,8 @@ Parser::OwningStmtResult Parser::ParseWhileStatement() {
if (ParseParenExprOrCondition(Cond))
return StmtError();
+ FullExprArg FullCond(Actions.FullExpr(Cond));
+
// C99 6.8.5p5 - In C99, the body of the if statement is a scope, even if
// there is no compound stmt. C90 does not have this clause. We only do this
// if the body isn't a compound statement to avoid push/pop in common cases.
@@ -776,7 +780,7 @@ Parser::OwningStmtResult Parser::ParseWhileStatement() {
if (Cond.isInvalid() || Body.isInvalid())
return StmtError();
- return Actions.ActOnWhileStmt(WhileLoc, Actions.FullExpr(Cond), move(Body));
+ return Actions.ActOnWhileStmt(WhileLoc, FullCond, move(Body));
}
/// ParseDoStatement