X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fstack.c;h=9b4e356fd802c1244d60e5b574e905b35c42529d;hb=ec8f76882145c71bef81a9cadf0bf51ff9fa5b35;hp=823433d913c9844e0713632c24b88cc04d7447d8;hpb=67ad9399e2a69757f06886ee61ce7f36d15e768a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/stack.c b/gdb/stack.c index 823433d913..9b4e356fd8 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -2433,13 +2433,12 @@ return_command (char *retval_exp, int from_tty) message. */ if (retval_exp) { - struct expression *retval_expr = parse_expression (retval_exp); - struct cleanup *old_chain = make_cleanup (xfree, retval_expr); + expression_up retval_expr = parse_expression (retval_exp); struct type *return_type = NULL; /* Compute the return value. Should the computation fail, this call throws an error. */ - return_value = evaluate_expression (retval_expr); + return_value = evaluate_expression (retval_expr.get ()); /* Cast return value to the return type of the function. Should the cast fail, this call throws an error. */ @@ -2454,7 +2453,6 @@ return_command (char *retval_exp, int from_tty) "Please use an explicit cast of the value to return.")); return_type = value_type (return_value); } - do_cleanups (old_chain); return_type = check_typedef (return_type); return_value = value_cast (return_type, return_value);