Skip to content

Commit

Permalink
fix #1060 using parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
crop2000 committed Oct 7, 2024
1 parent 111a299 commit 47675fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/generator/rust/rust_instructions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -565,18 +565,18 @@ class RustInstVisitor : public TextInstVisitor {

virtual void visit(Select2Inst* inst)
{
*fOut << "if ";
*fOut << "(if ";
inst->fCond->accept(this);
*fOut << " != 0 {";
inst->fThen->accept(this);
*fOut << "} else {";
inst->fElse->accept(this);
*fOut << "}";
*fOut << "})";
}

virtual void visit(IfInst* inst)
{
*fOut << "if ";
*fOut << "(if ";
inst->fCond->accept(this);
*fOut << " != 0 {";
tab(++fTab, *fOut);
Expand All @@ -590,7 +590,7 @@ class RustInstVisitor : public TextInstVisitor {
back(1, *fOut);
*fOut << "}";
} else {
*fOut << "}";
*fOut << "})";
}
tab(fTab, *fOut);
}
Expand Down

0 comments on commit 47675fa

Please sign in to comment.