A hopefully temporary fix for if-expression that has been rewritten into an
if-statement, where a object reference has the if-statement as its parent,
but is not part of the condition, then statements or else statements.
gcc/ada/ChangeLog:
* exp_util.adb (Get_Current_Value_Condition): Guard against orphaned
references in rewritten if-expressions.
if Previous = Condition (If_Stmt) then
return;
- else
- pragma Assert
- (List_Containing (Previous)
+ -- Guard against if-statements coming from if-statements
+ -- with broken chain of parents.
+
+ elsif Is_List_Member (Previous) then
+ pragma Assert (
+ List_Containing (Previous)
in Then_Statements (If_Stmt)
| Elsif_Parts (If_Stmt)
| Else_Statements (If_Stmt));
(if CV = If_Stmt
then List_Containing (Previous) = Then_Statements (CV)
else Previous = CV);
+ else
+ pragma Assert (From_Conditional_Expression (If_Stmt));
+ return;
end if;
else
return;