Add an expr::operation_up to struct expression
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index 58e39c7365f98f531afd6c27503bb2a589c6f923..235f2de68fe203d3b5c166d6e0e733dabd0b98c4 100644 (file)
@@ -1375,8 +1375,14 @@ set_command (const char *exp, int from_tty)
 {
   expression_up expr = parse_expression (exp);
 
-  if (expr->nelts >= 1)
-    switch (expr->elts[0].opcode)
+  enum exp_opcode opcode = OP_NULL;
+  if (expr->op != nullptr)
+    opcode = expr->op->opcode ();
+  else if (expr->nelts >= 1)
+    opcode = expr->elts[0].opcode;
+
+  if (opcode != OP_NULL)
+    switch (opcode)
       {
       case UNOP_PREINCREMENT:
       case UNOP_POSTINCREMENT:
This page took 0.023486 seconds and 4 git commands to generate.