summaryrefslogtreecommitdiff
path: root/src/decompiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/decompiler.cc')
-rw-r--r--src/decompiler.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decompiler.cc b/src/decompiler.cc
index 3eab2dd0..257de836 100644
--- a/src/decompiler.cc
+++ b/src/decompiler.cc
@@ -527,7 +527,10 @@ struct Decompiler {
ifs.precedence = Precedence::If;
return std::move(ifs);
} else {
- auto s = cat("if (", ifs.v[0], ") { ", thenp.v[0], " }");
+ auto s = cat("if (", ifs.v[0], ") {");
+ if (!thenp.v.empty())
+ s += cat(" ", thenp.v[0], " ");
+ s += "}";
if (elsep)
s += cat(" else { ", elsep->v[0], " }");
return Value{{std::move(s)}, Precedence::If};