-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Java: Adjust caching of BasicBlocks, BaseSSA, and CompileTimeConstants #19093
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
Changes from all commits
3313533
e75ed5a
3c6db09
dc0ca1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,18 +269,24 @@ private MethodCall getSystemPropertyFromSpringProperties(string propertyName) { | |
* for final variables. | ||
*/ | ||
private predicate localExprFlowPlusInitializers(Expr e1, Expr e2) { | ||
e1 = e2 or | ||
localFlowPlusInitializers(DataFlow::exprNode(e1), DataFlow::exprNode(e2)) | ||
} | ||
|
||
private predicate localFlowPlusInitializers(DataFlow::Node pred, DataFlow::Node succ) = | ||
fastTC(localFlowStepPlusInitializers/2)(pred, succ) | ||
|
||
/** | ||
* Holds if data can flow from `pred` to `succ` in zero or more | ||
* local (intra-procedural) steps or via instance or static variable intializers | ||
* Holds if data can flow from `pred` to `succ` in a | ||
* local (intra-procedural) step or via instance or static variable intializers | ||
* for final variables. | ||
*/ | ||
private predicate localFlowPlusInitializers(DataFlow::Node pred, DataFlow::Node succ) { | ||
exists(Variable v | v.isFinal() and pred.asExpr() = v.getInitializer() | | ||
DataFlow::localFlow(DataFlow::exprNode(v.getAnAccess()), succ) | ||
private predicate localFlowStepPlusInitializers(DataFlow::Node pred, DataFlow::Node succ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this rewrite semantics preserving? It looks like before it would calculate flow as
and now it is
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, it's not 100% semantics preserving, but I think the tweaked version makes more sense: If we're doing local flow plus initialization of final fields, then it seems like a mistake to rule out local flow prior to the initialization, like e.g. a cast or something like that. |
||
exists(Variable v | | ||
v.isFinal() and | ||
pred.asExpr() = v.getInitializer() and | ||
succ.asExpr() = v.getAnAccess() | ||
) | ||
or | ||
DataFlow::localFlow(pred, succ) | ||
DataFlow::localFlowStep(pred, succ) | ||
} |
Check warning
Code scanning / CodeQL
Acronyms should be PascalCase/camelCase. Warning