From: Andreas Schwab <schwab@linux-m68k.org>
To: Tom Tromey <tromey@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: creating the gdb-7.4 branch tomorrow (?)
Date: Sun, 22 Jul 2012 19:41:00 -0000 [thread overview]
Message-ID: <m2vchfr3co.fsf@igel.home> (raw)
In-Reply-To: <m34nxdoawj.fsf@fleche.redhat.com> (Tom Tromey's message of "Tue, 06 Dec 2011 10:41:32 -0700")
Tom Tromey <tromey@redhat.com> writes:
> +static void
> +filter_sals (struct symtabs_and_lines *sals)
> +{
> + int i, out, prev;
> +
> + out = 0;
> + for (i = 0; i < sals->nelts; ++i)
> + {
> + if (sals->sals[i].pspace == current_program_space
> + || sals->sals[i].symtab == NULL)
> + {
> + sals->sals[out] = sals->sals[i];
> + ++out;
> + }
> + }
> + sals->nelts = out;
> +
> + qsort (sals->sals, sals->nelts, sizeof (struct symtab_and_line),
> + compare_symtabs);
> +
> + out = 1;
> + prev = 0;
> + for (i = 1; i < sals->nelts; ++i)
> + {
> + if (compare_symtabs (&sals->sals[prev], &sals->sals[i]))
> + {
> + /* Symtabs differ. */
> + sals->sals[out] = sals->sals[i];
> + prev = out;
> + ++out;
> + }
> + }
> + sals->nelts = out;
> +
> + if (sals->nelts == 0)
This is never true. If sals->nelts == 0 on entry then it will always be
set to 1, causing the caller to crash when dereferencing sals->sals.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2012-07-22 19:41 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-05 8:19 Joel Brobecker
2011-12-06 18:45 ` Tom Tromey
2011-12-06 18:53 ` Tom Tromey
2011-12-06 18:54 ` Tom Tromey
2011-12-06 19:05 ` Tom Tromey
2011-12-06 19:05 ` Tom Tromey
2011-12-06 19:07 ` Tom Tromey
2011-12-06 19:10 ` Tom Tromey
2011-12-07 4:09 ` Hui Zhu
2011-12-07 9:54 ` Joel Brobecker
2011-12-07 16:24 ` Stan Shebs
2011-12-07 23:50 ` Stan Shebs
2011-12-08 8:22 ` Joel Brobecker
2011-12-07 9:11 ` Jan Kratochvil
2011-12-07 10:01 ` Joel Brobecker
2011-12-08 15:33 ` FYI: fixlet in ovsrch.exp (Was: creating the gdb-7.4 branch tomorrow (?)) Tom Tromey
2011-12-09 17:17 ` Crash regression for gdb.base/ending-run.exp [Re: creating the gdb-7.4 branch tomorrow (?)] Jan Kratochvil
2011-12-09 19:05 ` Tom Tromey
2011-12-09 21:00 ` Jan Kratochvil
2011-12-09 17:17 ` Regression for gdb.base/sigstep.exp with .debug_types " Jan Kratochvil
2011-12-09 17:26 ` Regression for gdb.base/sigstep.exp with .debug_types Jan Kratochvil
2011-12-09 20:50 ` Tom Tromey
2011-12-09 21:55 ` Jan Kratochvil
2011-12-10 9:46 ` Tom Tromey
2011-12-10 19:27 ` [commit] testsuite: KFAIL gdb.cp/static-method.exp [Re: Regression for gdb.base/sigstep.exp with .debug_types] Jan Kratochvil
2011-12-11 9:26 ` Joel Brobecker
2011-12-11 12:42 ` Jan Kratochvil
2011-12-11 12:46 ` Joel Brobecker
2011-12-14 19:02 ` [patch] gcc KFAILs to XFAILs [Re: [commit] testsuite: KFAIL gdb.cp/static-method.exp] Jan Kratochvil
2011-12-14 19:43 ` Doug Evans
2011-12-14 19:51 ` [doc patch] gdbint: XFAIL vs. KFAIL [Re: [patch] gcc KFAILs to XFAILs] Jan Kratochvil
2011-12-15 5:33 ` Eli Zaretskii
2011-12-19 11:16 ` Jan Kratochvil
2011-12-19 13:41 ` Eli Zaretskii
2011-12-19 13:42 ` [commit] " Jan Kratochvil
2011-12-19 13:43 ` [commit] [patch] gcc KFAILs to XFAILs [Re: [commit] testsuite: KFAIL gdb.cp/static-method.exp] Jan Kratochvil
2011-12-09 20:17 ` Regression for gdb.base/sigstep.exp with .debug_types [Re: creating the gdb-7.4 branch tomorrow (?)] Tom Tromey
2011-12-09 20:20 ` Jan Kratochvil
2011-12-14 11:52 ` creating the gdb-7.4 branch tomorrow (?) Andreas Schwab
2011-12-14 13:20 ` Joel Brobecker
2011-12-14 13:34 ` Andreas Schwab
2011-12-14 19:28 ` Joel Brobecker
2011-12-14 21:16 ` Andreas Schwab
2011-12-14 21:31 ` Joel Brobecker
2011-12-14 22:06 ` Andreas Schwab
2011-12-15 17:43 ` Tom Tromey
2012-07-22 19:41 ` Andreas Schwab [this message]
2012-08-15 19:34 ` Tom Tromey
2012-08-22 14:23 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2vchfr3co.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox