Commit b0c9cdca authored by yoogx's avatar yoogx

* Defend against incomplete process detection in case of

          threads that are part of a device driver.
parent e5f84c63
......@@ -945,9 +945,8 @@ package body Ocarina.Backends.Utils is
---------------------------
function Get_Container_Process (E : Node_Id) return Node_Id is
begin
pragma Assert (Present (E));
begin
case Kind (E) is
when K_Call_Instance =>
return Get_Container_Process (Parent_Sequence (E));
......@@ -965,6 +964,14 @@ package body Ocarina.Backends.Utils is
elsif Is_Process (E) or else Is_Device (E) then
return Parent_Subcomponent (E);
elsif Is_Abstract (E) then
-- It is allowed for a thread to be part of an
-- abstract component (e.g. a device driver). In this
-- case, we cannot retrieve the corresponding process
-- instance.
return No_Node;
else
raise Program_Error
with "Wrong node kind in " &
......
......@@ -158,7 +158,8 @@ package Ocarina.Backends.Utils is
function Get_Container_Process (E : Node_Id) return Node_Id;
-- Return the process subcomponent instance that contains the
-- subprogram call or thread instance E.
-- subprogram call or thread instance E, return No_Node if it
-- cannot be determined.
function Get_Container_Thread (E : Node_Id) return Node_Id;
-- Return the thread subcomponent instance that contains the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment