summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 886457823f..6a8375d04e 100644
--- a/parse.y
+++ b/parse.y
@@ -7902,6 +7902,14 @@ value_expr_gen(struct parser_params *parser, NODE *node)
break;
case NODE_IF:
+ if (!node->nd_body) {
+ node = node->nd_else;
+ break;
+ }
+ else if (!node->nd_else) {
+ node = node->nd_body;
+ break;
+ }
if (!value_expr(node->nd_body)) return Qfalse;
node = node->nd_else;
break;