]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
framefilter quit: Code cleanup: Avoid gotos
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Feb 2015 13:42:22 +0000 (14:42 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Feb 2015 13:42:22 +0000 (14:42 +0100)
commit46d020960241fcafd7d0ab483746a206829620ea
treea63dd7b52a73a08553399cec7fdda0949880dfdd
parenta9189a245363137825ce02a23202df45b04db179
framefilter quit: Code cleanup: Avoid gotos

goto error patters are sometimes AFAIK used in C for the cases like:
int retval=-1;
if (!(a=malloc())) goto error;
if (!(b=malloc())) goto error_a;
if (!(c=malloc())) goto error_b;
retval=0;
error_c: free(c);
error_b: free(b);
error_a: free(a);
error: return retval;

But here there is single error label with one do_cleanups() which I do not find
it worth the goto complication.  Without goto one can then furher merge code in
the exit paths in the next patches and ... after all it is all the same, just
without a goto.

gdb/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Substitute goto error.
Remove the error label.
gdb/ChangeLog
gdb/python/py-framefilter.c