Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org
Subject: Re: [RFA] libiberty/hashtab.c, higher_prime_index: avoid array overrun
Date: Thu, 03 Mar 2011 22:59:00 -0000	[thread overview]
Message-ID: <201103032259.p23Mx6R0014467@greed.delorie.com> (raw)
In-Reply-To: <4D70158A.5080209@vmware.com> (message from Michael Snyder on	Thu, 03 Mar 2011 14:26:18 -0800)


Bizzare, the problem isn't the hash loop, it's the error handler at
the end!  It never uses [30] for the main loop, only if you give it a
number between 0xfffffffb and 0xffffffff - and in the case where it
would use [30], it's supposed to abort anyway.

I couldn't figure out why your patch worked until I realized that the
main loop still fails!  It works because the error handler just
doesn't abort, returning the last array entry, which happens to be the
right one.

I think a suitable comment explaining what's actually going on, and
why it still works, is warranted... but your patch is OK with me
otherwise :-)


  reply	other threads:[~2011-03-03 22:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 22:04 Michael Snyder
2011-03-03 22:11 ` DJ Delorie
2011-03-03 22:26   ` Michael Snyder
2011-03-03 22:59     ` DJ Delorie [this message]
2011-03-07  2:59       ` Michael Snyder
2011-03-03 23:01     ` Mike Stump
2011-03-03 23:24       ` Michael Snyder
2011-03-04  0:14       ` Dave Korn
2011-03-04  0:19         ` DJ Delorie
2011-03-03 22:33   ` Michael Snyder

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=201103032259.p23Mx6R0014467@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.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