[PATCH] Fix heap-use-after-free in index-cached with --disable-threading

Pedro Alves pedro@palves.net
Fri May 10 19:16:41 GMT 2024


On 2024-05-04 12:09, Hannes Domani wrote:

> --- a/gdb/dwarf2/cooked-index.c
> +++ b/gdb/dwarf2/cooked-index.c
> @@ -513,7 +513,7 @@ cooked_index_worker::wait (cooked_state desired_state, bool allow_quit)
>  #else
>    /* Without threads, all the work is done immediately on the main
>       thread, and there is never anything to wait for.  */
> -  done = true;
> +  done = desired_state == cooked_state::CACHE_DONE;

I know nothing about this code, but I wondered if the "never" above in the comment
should say something else.  It matched the old code that just assigned to true, but
now it's conditional, which doesn't read like "never".



More information about the Gdb-patches mailing list