Java: Review fixes.

This commit is contained in:
Anders Schack-Mulligen
2023-08-08 13:37:40 +02:00
parent ab334f6c1b
commit 9d59f50340
4 changed files with 59 additions and 43 deletions

View File

@@ -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()
}

View File

@@ -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()
}

View File

@@ -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 }