Skip to content

Commit

Permalink
* (Get_Source_Text): defend against E`s kind
Browse files Browse the repository at this point in the history
  • Loading branch information
yoogx committed Oct 25, 2021
1 parent 41c020a commit 563ae64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/backends/ocarina-backends-properties.adb
Expand Up @@ -1542,6 +1542,14 @@ package body Ocarina.Backends.Properties is

function Get_Source_Text (E : Node_Id) return Name_Array is
begin
-- Ensure E has the proper kind; it is safe to ignore this case, e.g.
-- when E is computed from Get_Compute_Entrypoint and the model has a
-- Compute_Entrypoint_Source_Text set

if Present (E) and then Kind (E) = K_Property_Association_Instance then
return Empty_Name_Array;
end if;

return Check_And_Get_Property (E, Source_Text);
end Get_Source_Text;

Expand Down

0 comments on commit 563ae64

Please sign in to comment.