-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix arbitrary_cpi lint and add documentation to it #75
Conversation
The PR does not change much: The PR moves the code finding the alias of program_id to a separate function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have just a couple nits. This PR introduces commented code, which appears to be incomplete, e.g.:
// println!("5. {:?}, {:?}", stmt, stmt.kind);
// println!("2. {:?}, {:?}, {:?}", assign_place, inst_arg, rvalue);
// println!("4. {:?}", inst_arg);
// println!("x. {:?}", pl);
lints/arbitrary_cpi/src/lib.rs
Outdated
/// - If one of the arg accesses `program_id`, check if the basic block containing the comparison | ||
/// dominates the basic block containing call to `invoke` ensuring the `program_id` is checked in all execution | ||
/// paths. | ||
/// - If basic block does not dominate or there is no such comparison report the call to `invoke` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sentence incomplete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the sentence is complete. Is anything not clear?
9688681
to
4113122
Compare
I have clarified documentation and update the PR. I have also updated to follow the "caller" to "callee" topological order for functions. |
The
arbitrary_cpi
lint implementation had an incorrect match statement of which one of arm is never executed. The lint is updated to fix that.The PR also
How the lint is implemented
documentation for the lint.