diff options
Diffstat (limited to 'gdb/expprint.c')
-rw-r--r-- | gdb/expprint.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c index 026b775..5427a56 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -241,18 +241,14 @@ print_subexp_standard (struct expression *exp, int *pos, case OP_OBJC_MSGCALL: { /* Objective C message (method) call. */ - gdb::unique_xmalloc_ptr<char> selector; - (*pos) += 3; nargs = longest_to_int (exp->elts[pc + 2].longconst); fprintf_unfiltered (stream, "["); print_subexp (exp, pos, stream, PREC_SUFFIX); - if (0 == target_read_string (exp->elts[pc + 1].longconst, - &selector, 1024, NULL)) - { - error (_("bad selector")); - return; - } + gdb::unique_xmalloc_ptr<char> selector + = target_read_string (exp->elts[pc + 1].longconst, 1024); + if (selector == nullptr) + error (_("bad selector")); if (nargs) { char *s, *nextS; |