]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lib-xref.adb: Add error defense.
authorRobert Dewar <dewar@adacore.com>
Fri, 1 Aug 2008 10:33:29 +0000 (12:33 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2008 10:33:29 +0000 (12:33 +0200)
2008-08-01  Robert Dewar  <dewar@adacore.com>

* lib-xref.adb: Add error defense.

From-SVN: r138507

gcc/ada/lib-xref.adb

index 8af553fef5993afd2943c690e8cc0215fc39c10c..2ab83c53aa8d9d54ab6e06a787a65440442b243f 100644 (file)
@@ -1834,7 +1834,11 @@ package body Lib.Xref is
                            Par : Node_Id;
 
                         begin
-                           if Ekind (Scope (E)) /= E_Generic_Package then
+                           --  The Present check here is an error defense
+
+                           if Present (Scope (E))
+                             and then Ekind (Scope (E)) /= E_Generic_Package
+                           then
                               return False;
                            end if;