2012-12-14 Yufeng Zhang <yufeng.zhang@arm.com>
[deliverable/binutils-gdb.git] / gdb / linespec.c
index 06634d28394c333ef2b6dadfd7f2f4dc19e80adf..e9918b1943a8e107fdec6953385b9994eddb6a91 100644 (file)
@@ -2095,20 +2095,17 @@ parse_linespec (linespec_parser *parser, char **argptr)
       cleanup = make_cleanup (xfree, var);
       PARSER_RESULT (parser)->line_offset
        = linespec_parse_variable (PARSER_STATE (parser), var);
+      do_cleanups (cleanup);
 
       /* If a line_offset wasn't found (VAR is the name of a user
         variable/function), then skip to normal symbol processing.  */
       if (PARSER_RESULT (parser)->line_offset.sign != LINE_OFFSET_UNKNOWN)
        {
-         discard_cleanups (cleanup);
-
          /* Consume this token.  */
          linespec_lexer_consume_token (parser);
 
          goto convert_to_sals;
        }
-
-      do_cleanups (cleanup);
     }
   else if (token.type != LSTOKEN_STRING && token.type != LSTOKEN_NUMBER)
     unexpected_linespec_error (parser);
This page took 0.023805 seconds and 4 git commands to generate.