PVS/V547: viml/parser/expressions.c: Expression is always true

This commit is contained in:
Justin M. Keyes
2019-01-04 02:29:39 +01:00
parent 788ade1d29
commit 6abdc0aeec

View File

@@ -2845,12 +2845,15 @@ viml_pexpr_parse_no_paren_closing_error: {}
kvi_push(ast_stack, new_top_node_p); kvi_push(ast_stack, new_top_node_p);
want_node = kENodeOperator; want_node = kENodeOperator;
} else { } else {
if (want_node == kENodeValue) { switch (want_node) {
case kENodeValue: {
NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeNested); NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeNested);
*top_node_p = cur_node; *top_node_p = cur_node;
kvi_push(ast_stack, &cur_node->children); kvi_push(ast_stack, &cur_node->children);
HL_CUR_TOKEN(NestingParenthesis); HL_CUR_TOKEN(NestingParenthesis);
} else if (want_node == kENodeOperator) { break;
}
case kENodeOperator: {
if (prev_token.type == kExprLexSpacing) { if (prev_token.type == kExprLexSpacing) {
// For some reason "function (args)" is a function call, but // For some reason "function (args)" is a function call, but
// "(funcref) (args)" is not. AFAIR this somehow involves // "(funcref) (args)" is not. AFAIR this somehow involves
@@ -2866,9 +2869,8 @@ viml_pexpr_parse_no_paren_closing_error: {}
NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeCall); NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeCall);
ADD_OP_NODE(cur_node); ADD_OP_NODE(cur_node);
HL_CUR_TOKEN(CallingParenthesis); HL_CUR_TOKEN(CallingParenthesis);
} else { break;
// Currently it is impossible to reach this. }
assert(false);
} }
want_node = kENodeValue; want_node = kENodeValue;
} }