This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/5] Fix memory leak in exception code
On 4/25/19 5:52 PM, Tom Tromey wrote:
> PR gdb/24475 concerns a memory leak coming from gdb's exception
> handling code.
>
> The leak occurs because throw_exception_sjlj does not arrange to
> destroy the exception object it is passed. However, because
> gdb_exception has a destructor, it's undefined to longjmp in this
> situation.
>
> This patch fixes the problem by avoiding the need to run any
> destructors in gdb_rl_callback_handler, by making the gdb_exception
> "static".
>
Why fix it like this, instead of fixing it like in the guile patch?
I'd think you could even use a common POD type for both guile and here?
Thanks,
Pedro Alves