Skip to content

Enumeration out parameters cause failed precondition from ireps.ads:1875 in gnat2goto #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tjj2017 opened this issue Jun 29, 2019 · 2 comments

Comments

@tjj2017
Copy link
Collaborator

tjj2017 commented Jun 29, 2019

No description provided.

@tjj2017 tjj2017 changed the title Enumeration out parameters cause failed precondition from ireps.ads:1875 ignat2goto Enumeration out parameters cause failed precondition from ireps.ads:1875 in gnat2goto Jun 29, 2019
@tjj2017
Copy link
Collaborator Author

tjj2017 commented Jun 29, 2019

gnat2goto fails with above precondition failure when translating UKNI/main.adb line 247 which calls a procedure with an enumeration out parameter.

The problem seems to lie in gnat2goto driver/tree_walk.adb procedure Handle_Parameter. The function Wrap_Argument is called with a parameter obtained from the call of the function Handle_Enum_Symbol_Members which appears to return the wrong sort of Irep for the function Make_Address_Of called by Wrap_Argument.

Regression test created in PR #262 to demonstrate this fault.

@tjj2017
Copy link
Collaborator Author

tjj2017 commented Jul 12, 2019

A bit more information following investigation to failed precondition from reps.ads:1655 PR #265. The kind of Irep passed to Set_Object called by Make_Address_Of is I_SYMBOL_EXPR which does not satisfy the precondition of Set_Object which is
Pre => Kind (I) in I_Address_Of_Expr
| I_Dereference_Expr and then
Kind (Value) in Class_Expr;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant