+2021-03-08 Tom Tromey <tom@tromey.com>
+
+ * printcmd.c (set_command): Remove null check.
+ * value.c (init_if_undefined_command): Remove null check.
+
2021-03-08 Tom Tromey <tom@tromey.com>
* parse.c (parser_state::push_symbol, parser_state::push_dollar):
{
expression_up expr = parse_expression (exp);
- if (expr->op != nullptr)
- switch (expr->op->opcode ())
- {
- case UNOP_PREINCREMENT:
- case UNOP_POSTINCREMENT:
- case UNOP_PREDECREMENT:
- case UNOP_POSTDECREMENT:
- case BINOP_ASSIGN:
- case BINOP_ASSIGN_MODIFY:
- case BINOP_COMMA:
- break;
- default:
- warning
- (_("Expression is not an assignment (and might have no effect)"));
- }
+ switch (expr->op->opcode ())
+ {
+ case UNOP_PREINCREMENT:
+ case UNOP_POSTINCREMENT:
+ case UNOP_PREDECREMENT:
+ case UNOP_POSTDECREMENT:
+ case BINOP_ASSIGN:
+ case BINOP_ASSIGN_MODIFY:
+ case BINOP_COMMA:
+ break;
+ default:
+ warning
+ (_("Expression is not an assignment (and might have no effect)"));
+ }
evaluate_expression (expr.get ());
}
/* Validate the expression.
Was the expression an assignment?
Or even an expression at all? */
- if (expr->op == nullptr || expr->first_opcode () != BINOP_ASSIGN)
+ if (expr->first_opcode () != BINOP_ASSIGN)
error (_("Init-if-undefined requires an assignment expression."));
/* Extract the variable from the parsed expression. */