]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Restore context on failure in loading of renamed child unit
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 25 May 2021 15:39:26 +0000 (17:39 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 8 Jul 2021 13:34:20 +0000 (13:34 +0000)
gcc/ada/

* lib-load.adb (Load): Replace early return with goto to properly
restore context on failure.

gcc/ada/lib-load.adb

index f7534b6016b5a6a13f97cb46f919f940a999eb17..737762c5e7abba7ff3dc0a875c606baa52f9f0d8 100644 (file)
@@ -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