-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: Fix or disable CPs introduced by #2700 and #2875. #2973
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
Conversation
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.
In reviewing this, do you want me to merely look for noticeable errors, and make constructive suggestions on the changes as done, or should I also try to understand the cause of the CP and see if there might be some kind of alternative solution?
This is mostly a hotfix, so that we can progress with the on-going dist upgrade, and so an in-depth review is probably not needed. Just a quick look to see that I haven't done something completely ridiculous. Of course, if you do figure out a solution for the CP that I just removed by brute force (by essentially reverting to the previous behaviour), that would be great. |
Ok sounds good. |
private predicate clears_taint(ControlFlowNode final_test, ControlFlowNode tainted, ControlFlowNode test, boolean sense) { | ||
test_equality_with_const(final_test, tainted, sense) | ||
private predicate clears_taint(ControlFlowNode tainted, ControlFlowNode test, boolean sense) { | ||
test_equality_with_const(test, tainted, sense) | ||
or | ||
test_in_const_seq(final_test, tainted, sense) | ||
test_in_const_seq(test, tainted, sense) | ||
or | ||
test.(UnaryExprNode).getNode().getOp() instanceof Not and | ||
exists(ControlFlowNode nested_test | | ||
nested_test = test.(UnaryExprNode).getOperand() and | ||
clears_taint(final_test, tainted, nested_test, sense.booleanNot()) | ||
clears_taint(tainted, nested_test, sense.booleanNot()) | ||
) | ||
} |
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.
Looking over this code again, I'm so confused about final_test
and what it's supposed to do. Thanks for fixing this up 👍
I could not find an easy way to avoid the cartesian product in #2700, so I have simply disabled the code responsible for it.