Check for declaration of global variables prior to use in the ownership
checking for SPARK.
There is no impact on compilation.
2019-07-09 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_spark.adb (Get_Perm_Or_Tree): Issue an error when
encountering unknown global variable.
From-SVN: r273267
+2019-07-09 Yannick Moy <moy@adacore.com>
+
+ * sem_spark.adb (Get_Perm_Or_Tree): Issue an error when
+ encountering unknown global variable.
+
2019-07-09 Yannick Moy <moy@adacore.com>
* sem_spark.adb (Check_Expression): Change signature to take an
C : constant Perm_Tree_Access :=
Get (Current_Perm_Env, Unique_Entity (Entity (N)));
begin
- pragma Assert (C /= null);
+ -- Except during elaboration, the root object should have been
+ -- declared and entered into the current permission
+ -- environment.
+
+ if not Inside_Elaboration
+ and then C = null
+ then
+ Illegal_Global_Usage (N);
+ end if;
+
return (R => Unfolded, Tree_Access => C);
end;