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

Array use after pop front detector #41

Merged
merged 6 commits into from
Sep 20, 2023

Conversation

tarunbhm
Copy link
Contributor

@tarunbhm tarunbhm commented Aug 30, 2023

Ready for review.

@tarunbhm tarunbhm linked an issue Aug 30, 2023 that may be closed by this pull request
@tarunbhm tarunbhm changed the title [WIP] Array use after pop front detector Array use after pop front detector Sep 1, 2023
Comment on lines 76 to 78
let message = format!(
"An array is used after removing elements from it in the function {}",
&function.name()
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to print the array ID in sierra

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 108 to 131
|| self.check_calls(
compilation_unit,
function,
bad_array,
&mut function.private_functions_calls(),
)
|| self.check_calls(
compilation_unit,
function,
bad_array,
&mut function.library_functions_calls(),
)
|| self.check_calls(
compilation_unit,
function,
bad_array,
&mut function.external_functions_calls(),
)
|| self.check_calls(
compilation_unit,
function,
bad_array,
&mut function.events_emitted(),
);
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 you can make this into a single call to check_calls by chaining the iterators

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@smonicas smonicas merged commit e32a876 into master Sep 20, 2023
4 checks passed
@smonicas smonicas deleted the array-use-after-pop_front-detector branch September 20, 2023 18:26
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.

Detector: array use after pop_front
2 participants