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
API to obtain the "then" store for boolean function call arguments #5151
Comments
So basically add a method annotation that makes dataflow treat |
Thanks, @smillst! By poking around that code, I found the |
After playing around with this a bit, it's easy enough for us to make our own However, one issue I am running into is that Label is not part of the public API, so I am not sure how to create the required control flow jumps to implement something similar to Another option is to generate an artificial Not sure what the implications are on the CF side of making |
This enables greater extensibility in CFG construction; see #5151 (comment)
Thanks for the investigation @lazaroclapp. I opened #5152 to make |
This enables greater extensibility in CFG construction; see #5151 (comment)
@lazaroclapp |
Opening a new PR with a few more APIs that I needed to implement uber/NullAway#608. p.s. @msridhar let me know if the general approach of the NullAway PR makes sense. No need for an in-depth review yet, but worth making sure we will not need other CF APIs for this :) |
#5156 and uber/NullAway#609 have landed so we are all set here. Thanks again for the help! |
This enables greater extensibility in CFG construction; see typetools#5151 (comment)
In NullAway, we'd like to add reasoning about methods like Guava's
Precondition.checkArgument
, for cases like the following:We would like to be able to reason that the
o.toString()
call cannot throw an NPE. The behavior ofcheckArgument
could be specified with something like a JetBrains @Contract annotation@Contract(false, _ -> fail)
. This annotation means that any dataflow facts that hold when the first argument evaluates totrue
can be propagated to the normal (non-exceptional) successor of acheckArgument
call.To implement this, we would need access to the "then" store at the program point after the first parameter to a
checkArgument
call is evaluated. Do you have a suggestion on the right approach to use to access this information? We're also willing to contribute a new API if needed. Thanks! /cc @lazaroclappThe text was updated successfully, but these errors were encountered: