Commit 8beb47ee authored by hugues.jerome's avatar hugues.jerome

* Handle more error cases in REAL backend



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1101 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 9f7a0c51
......@@ -987,7 +987,11 @@ package body Ocarina.Backends.REAL is
when K_Check_Expression =>
if Present (Left_Expr (E)) and then Present (Right_Expr (E)) then
Compute_Check_Expression (Left_Expr (E), T1, R1);
if T1 = RT_Error then
if T1 = RT_Unknown then
Ret := RT_Boolean;
Result := New_Boolean_Value (False);
return;
elsif T1 = RT_Error then
Ret := RT_Error;
return;
end if;
......@@ -1086,7 +1090,11 @@ package body Ocarina.Backends.REAL is
when OV_Greater_Equal =>
Compute_Check_Expression (Right_Expr (E), T2, R2);
if T2 = RT_Error then
if T2 = RT_Unknown then
Ret := RT_Boolean;
Result := New_Boolean_Value (True);
return;
elsif T2 = RT_Error then
Ret := RT_Error;
return;
end if;
......@@ -1944,7 +1952,7 @@ package body Ocarina.Backends.REAL is
(First_Node (Parameters (E)), T2, R);
if T2 = RT_Unknown then
Display_Located_Error
(Loc (E), "use default value",
(Loc (E), "use default float value of 0.0",
Fatal => False, Warning => True);
T := RT_Float;
Result := New_Real_Value (0.0);
......@@ -2002,7 +2010,16 @@ package body Ocarina.Backends.REAL is
begin
Compute_Check_Expression
(First_Node (Parameters (E)), T2, R);
if T2 = RT_Error then
if T2 = RT_Unknown then
Display_Located_Error
(Loc (E), "use default float value of 0.0",
Fatal => False, Warning => True);
T := RT_Float;
Result := New_Real_Value (0.0);
return;
elsif T2 = RT_Error then
T := RT_Error;
return;
end if;
......@@ -2053,7 +2070,15 @@ package body Ocarina.Backends.REAL is
begin
Compute_Check_Expression
(First_Node (Parameters (E)), T2, R);
if T2 = RT_Error then
if T2 = RT_Unknown then
Display_Located_Error
(Loc (E), "use default boolean value of true",
Fatal => False, Warning => True);
result := New_Boolean_Value (True);
T := RT_Boolean;
return;
elsif T2 = RT_Error then
T := RT_Error;
return;
end if;
......@@ -2458,7 +2483,7 @@ package body Ocarina.Backends.REAL is
if T2 = RT_Unknown then
Display_Located_Error
(Loc (E), "use default value",
(Loc (E), "use default float value of 0.0",
Fatal => False, Warning => True);
T := RT_Float;
Result := New_Real_Value (0.0);
......
......@@ -158,7 +158,7 @@ package body Ocarina.REAL_Values is
when LT_List =>
-- XXX FIXME :
raise Program_Error with "not implemented yet";
return "Not implemented yet";
when LT_Range =>
if Value.RSign_Left then
......
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