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

Look at stack struct for local variables #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simonlindholm
Copy link
Collaborator

This adds missing sp vars that were either only read from (due to being fake and actually part of structs that we fail to detect), or are structs/arrays which never ended up in local_vars because we only generated subfield accesses. Despite adding fake vars I think it's an improvement to have them in the output for the sake of coherence?

(Hard to give project diffs because of how separated declarations are from usages.)

@simonlindholm simonlindholm requested a review from zbanks May 26, 2022 22:24
Copy link
Collaborator

@zbanks zbanks left a comment

Choose a reason for hiding this comment

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

It seems like the output changes are pretty small, so I'm good with adding this. (I don't feel super strongly about it though)

On Discord you mentioned:

maybe we should instead emit unkspXX for reads from unwritted/unaddressed stack locations
to show that something weird is probably up

-- I think this would be neat, but I don't know if it's worth adding? (It might not be worth the code)

any_decl = True
stack_struct_fields = stack_struct_fields[::-1]
for field in stack_struct_fields:
type_decl = field.type.to_decl(field.name, fmt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think LocalVar.toplevel_decl(...) can be deleted now?

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.

None yet

2 participants