mirror of
https://github.com/github/codeql.git
synced 2026-02-23 10:23:41 +01:00
Java: Review fixes.
This commit is contained in:
@@ -65,7 +65,7 @@ private module Cached {
|
||||
TCollectionContent() or
|
||||
TMapKeyContent() or
|
||||
TMapValueContent() or
|
||||
TClosureContent(CapturedVariable v) or
|
||||
TCapturedVariableContent(CapturedVariable v) or
|
||||
TSyntheticFieldContent(SyntheticField s)
|
||||
|
||||
cached
|
||||
@@ -75,7 +75,7 @@ private module Cached {
|
||||
TCollectionContentApprox() or
|
||||
TMapKeyContentApprox() or
|
||||
TMapValueContentApprox() or
|
||||
TClosureContentApprox(CapturedVariable v) or
|
||||
TCapturedVariableContentApprox(CapturedVariable v) or
|
||||
TSyntheticFieldApproxContent()
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ class CapturedParameter = CaptureInput::CapturedParameter;
|
||||
|
||||
module CaptureFlow = VariableCapture::Flow<CaptureInput>;
|
||||
|
||||
CaptureFlow::ClosureNode asClosureNode(Node n) {
|
||||
private CaptureFlow::ClosureNode asClosureNode(Node n) {
|
||||
result = n.(CaptureNode).getSynthesizedCaptureNode() or
|
||||
result.(CaptureFlow::ExprNode).getExpr() = n.asExpr() or
|
||||
result.(CaptureFlow::ExprPostUpdateNode).getExpr() =
|
||||
@@ -165,11 +165,11 @@ CaptureFlow::ClosureNode asClosureNode(Node n) {
|
||||
n
|
||||
}
|
||||
|
||||
private predicate captureStoreStep(Node node1, ClosureContent c, Node node2) {
|
||||
private predicate captureStoreStep(Node node1, CapturedVariableContent c, Node node2) {
|
||||
CaptureFlow::storeStep(asClosureNode(node1), c.getVariable(), asClosureNode(node2))
|
||||
}
|
||||
|
||||
private predicate captureReadStep(Node node1, ClosureContent c, Node node2) {
|
||||
private predicate captureReadStep(Node node1, CapturedVariableContent c, Node node2) {
|
||||
CaptureFlow::readStep(asClosureNode(node1), c.getVariable(), asClosureNode(node2))
|
||||
}
|
||||
|
||||
@@ -565,7 +565,9 @@ ContentApprox getContentApprox(Content c) {
|
||||
or
|
||||
c instanceof MapValueContent and result = TMapValueContentApprox()
|
||||
or
|
||||
exists(CapturedVariable v | c = TClosureContent(v) and result = TClosureContentApprox(v))
|
||||
exists(CapturedVariable v |
|
||||
c = TCapturedVariableContent(v) and result = TCapturedVariableContentApprox(v)
|
||||
)
|
||||
or
|
||||
c instanceof SyntheticFieldContent and result = TSyntheticFieldApproxContent()
|
||||
}
|
||||
|
||||
@@ -275,10 +275,10 @@ class MapValueContent extends Content, TMapValueContent {
|
||||
}
|
||||
|
||||
/** A captured variable. */
|
||||
class ClosureContent extends Content, TClosureContent {
|
||||
class CapturedVariableContent extends Content, TCapturedVariableContent {
|
||||
CapturedVariable v;
|
||||
|
||||
ClosureContent() { this = TClosureContent(v) }
|
||||
CapturedVariableContent() { this = TCapturedVariableContent(v) }
|
||||
|
||||
CapturedVariable getVariable() { result = v }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user