https://gcc.gnu.org/g:492263d2a4b453229d7396aa1b58cbbf9c72c7e3
commit r17-1965-g492263d2a4b453229d7396aa1b58cbbf9c72c7e3 Author: Olivier Hainque <[email protected]> Date: Tue Jun 16 15:54:50 2026 +0000 ada: Stop Unwind_Backtrace on null PC A null "pc" return address in the Unwind_Backtrace callback normally means that unwinding has reached the top of the call chain. Or something else, abnormal. Recognize this early as a stop condition, which makes sure we don't accidentally add an entry for it after applying possible offsets. gcc/ada/ChangeLog: * tracebak.c (trace_callback): Return early for pc == 0; Diff: --- gcc/ada/tracebak.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 2c80b2a16108..709322ad13d4 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -655,6 +655,10 @@ trace_callback (struct _Unwind_Context * uw_context, uw_data_t * uw_data) pc = (char *) _Unwind_GetIP (uw_context); #endif + /* Common case of top-of-call-chain reached. */ + if (pc == (char *)0) + return _URC_NORMAL_STOP; + if (uw_data->n_frames_skipped < uw_data->n_frames_to_skip) { uw_data->n_frames_skipped ++;
