Skip to content
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

fixes the order of arguments in the callsites plugin #939

Merged
merged 9 commits into from
Apr 1, 2019

Conversation

gitoleg
Copy link
Contributor

@gitoleg gitoleg commented Mar 29, 2019

Previously, the callsites plugin was inserting arguments in a such way that dual intent arguments were evaluated after the return arguments. This PR fixes the order, so that the in/our arguments are evaluated before the out arguments. It is also takes extra care and sorts the arguments before inserting, so that we do not rely too much on the order of arguments in the subroutine term.

This PR fixes #740 in which a wrong order of evaluation led to the destruction of a def-use chain.

@ivg ivg changed the title defines an order of subroutines's arguments fixes the order of arguments in the callsites plugin Apr 1, 2019
(* Note, that we intentionally invert compare for Both and Out
arguments, since they will be inserted in reverted order later. *)
let enum_args t =
let compare x y = match Arg.intent x, Arg.intent y with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this order coincides with the intent_order, so it is easier and better just to use it.

@gitoleg gitoleg merged commit 651003f into BinaryAnalysisPlatform:master Apr 1, 2019
@gitoleg gitoleg deleted the fix-callsites branch May 13, 2020 21:09
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

Successfully merging this pull request may close these issues.

the warn-unused-plugin is broken in 1.3
2 participants