Some tools that use the project manager might be creating a project
on the fly (no reference to an actual project file), which could
result in a Constraint_Error in this code.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-01-24  Emmanuel Briot  <br...@adacore.com>

        * prj-nmsc.adb (Check_File): Add protection when the source is
        not fully initialized.

Index: prj-nmsc.adb
===================================================================
--- prj-nmsc.adb        (revision 207032)
+++ prj-nmsc.adb        (working copy)
@@ -7051,7 +7051,9 @@
             --  Check if it is OK to have the same file name in several
             --  source directories.
 
-            if Source_Dir_Rank = Name_Loc.Source.Source_Dir_Rank then
+            if Name_Loc.Source /= No_Source
+              and then Source_Dir_Rank = Name_Loc.Source.Source_Dir_Rank
+            then
                Error_Msg_File_1 := File_Name;
                Error_Msg
                  (Data.Flags,

Reply via email to