@@ -1012,7 +1012,10 @@ bool Converter::VisitDoStmt(clang::DoStmt *stmt) {
10121012 Convert (stmt->getBody ());
10131013 curr_for_inc_.pop ();
10141014 StrCat (keyword::kIf , token::kNot );
1015- ConvertCondition (stmt->getCond ());
1015+ {
1016+ PushParen paren (*this );
1017+ ConvertCondition (stmt->getCond ());
1018+ }
10161019 {
10171020 PushBrace if_brace (*this );
10181021 StrCat (keyword::kBreak , token::kSemiColon );
@@ -1748,13 +1751,13 @@ void Converter::ConvertIntegralToBooleanCast(clang::ImplicitCastExpr *expr) {
17481751 if (binop->isLogicalOp ()) {
17491752 PushParen outer (*this );
17501753 {
1751- PushParen paren (*this );
1752- ConvertCondition (binop->getLHS ());
1754+ PushParen paren (*this );
1755+ ConvertCondition (binop->getLHS ());
17531756 }
17541757 StrCat (binop->getOpcodeStr ());
17551758 {
1756- PushParen paren (*this );
1757- ConvertCondition (binop->getRHS ());
1759+ PushParen paren (*this );
1760+ ConvertCondition (binop->getRHS ());
17581761 }
17591762 return ;
17601763 }
@@ -2150,10 +2153,10 @@ bool Converter::VisitUnaryOperator(clang::UnaryOperator *expr) {
21502153 bool needs_int_cast = expr->getType ()->isIntegerType ();
21512154 PushParen paren_cast (*this , needs_int_cast);
21522155 StrCat (token::kNot );
2153- {
2156+ {
21542157 PushParen paren (*this );
2155- ConvertCondition (sub_expr);
2156- }
2158+ ConvertCondition (sub_expr);
2159+ }
21572160 if (needs_int_cast) {
21582161 ConvertCast (expr->getType ());
21592162 }
0 commit comments