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

Sometimes missing args in function calls with more than 4 parameters #163

Open
zbanks opened this issue Nov 1, 2021 · 0 comments
Open

Comments

@zbanks
Copy link
Collaborator

zbanks commented Nov 1, 2021

There's a small bug with subroutine_args in translate_node_body. This array keeps track of the arguments after the 4th for the next function call. However, it is only local to the single node.

If there is a branch while the asm is setting up for a function call with many arguments, then the subroutine_args from before the branch are dropped. This seems to happen mostly from float/int conversions.

I put together a hack to keep this array across node boundaries -- but this has a few problems:

  • The expressions in the array should probably be turned into phi expressions. (Maybe it would then be more elegant to shove these into the register dict?)
  • Maybe a better "fix" would be to add an asm pattern for the float/int conversions, to sidestep the issue?
    • Maybe add a warning for gaps in the subroutine_args array, or for unused args?

I ran the hack branch against MM & PM as a resource for decompers -- but in many cases the changes aren't correct.

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