From e581fbeab695838c3e36bf31072c1dad11d9f81b Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 25 May 2021 17:39:26 +0200 Subject: [PATCH] [Ada] Restore context on failure in loading of renamed child unit gcc/ada/ * lib-load.adb (Load): Replace early return with goto to properly restore context on failure. --- gcc/ada/lib-load.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb index f7534b6016b5..737762c5e7ab 100644 --- a/gcc/ada/lib-load.adb +++ b/gcc/ada/lib-load.adb @@ -451,8 +451,8 @@ package body Lib.Load is With_Node => With_Node); if Unump = No_Unit then - Parsing_Main_Extended_Source := Save_PMES; - return No_Unit; + Unum := No_Unit; + goto Done; end if; -- If parent is a renaming, then we use the renamed package as -- 2.47.2