This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: fix named event hashtable rebuild


On Thu, Dec 10, 2009 at 8:15 PM, Joern Rennecke <amylaar@spamcop.net> wrote:
> When I made the event table extension share code for the hash table
> rebuild with the initial hash table generation, I forgot to change the
> loop bound to actually include the dynamically allocated events.
> That would mean the first dynamically allocated event is not found in
> subsequent searches. ?And worse if we ever extend the event table a
> second time.
> Fixed with the attached patch.
>
> This patch should be inherently safe, as the changed function is only used
> by plugins.

Ok.

Thanks,
Richard.

> 2009-12-10 ?Joern Rennecke ?<amylaar@spamcop.net>
>
> ? ? ? ?* plugin.c (get_named_event_id): Fix hash table rebuild to include
> ? ? ? ?dynamically allocated events.
>
> Index: plugin.c
> ===================================================================
> --- plugin.c ? ?(revision 155001)
> +++ plugin.c ? ?(working copy)
> @@ -316,7 +316,7 @@ get_named_event_id (const char *name, en
> ? ? ? int i;
>
> ? ? ? event_tab = htab_create (150, htab_hash_string, htab_event_eq, NULL);
> - ? ? ?for (i = 0; i < PLUGIN_EVENT_FIRST_DYNAMIC; i++)
> + ? ? ?for (i = 0; i < event_last; i++)
> ? ? ? ?{
> ? ? ? ? ?slot = htab_find_slot (event_tab, plugin_event_name[i], INSERT);
> ? ? ? ? ?gcc_assert (*slot == HTAB_EMPTY_ENTRY);
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]