| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0fb27fb commit 12d6875
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,9 +91,6 @@ extensions: | |||
| 91 | 91 | - ["java.lang", "Iterable", True, "iterator", "()", "", "Argument[this].Element", "ReturnValue.Element", "value", "manual"] | |
| 92 | 92 | - ["java.lang", "Iterable", True, "spliterator", "()", "", "Argument[this].Element", "ReturnValue.Element", "value", "manual"] | |
| 93 | 93 | - ["java.lang", "NullPointerException", False, "NullPointerException", "(String)", "", "Argument[0]", "Argument[this].SyntheticField[java.lang.Throwable.message]", "value", "manual"] | |
| 94 | - - ["java.lang", "Object", True, "clone", "", "", "Argument[this].Element", "ReturnValue.Element", "value", "manual"] | ||
| 95 | - - ["java.lang", "Object", True, "clone", "", "", "Argument[this].MapKey", "ReturnValue.MapKey", "value", "manual"] | ||
| 96 | - - ["java.lang", "Object", True, "clone", "", "", "Argument[this].MapValue", "ReturnValue.MapValue", "value", "manual"] | ||
| 97 | 94 | - ["java.lang", "RuntimeException", False, "RuntimeException", "(String)", "", "Argument[0]", "Argument[this].SyntheticField[java.lang.Throwable.message]", "value", "manual"] | |
| 98 | 95 | - ["java.lang", "RuntimeException", False, "RuntimeException", "(String,Throwable)", "", "Argument[0]", "Argument[this].SyntheticField[java.lang.Throwable.message]", "value", "manual"] | |
| 99 | 96 | - ["java.lang", "RuntimeException", False, "RuntimeException", "(String,Throwable)", "", "Argument[1]", "Argument[this].SyntheticField[java.lang.Throwable.cause]", "value", "manual"] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,8 @@ module JavaDataFlow implements InputSig<Location> { | |||
| 22 | 22 | ||
| 23 | 23 | predicate getSecondLevelScope = Private::getSecondLevelScope/1; | |
| 24 | 24 | ||
| 25 | + predicate validParameterAliasStep = Private::validParameterAliasStep/2; | ||
| 26 | + | ||
| 25 | 27 | predicate mayBenefitFromCallContext = Private::mayBenefitFromCallContext/1; | |
| 26 | 28 | ||
| 27 | 29 | predicate viableImplInCallContext = Private::viableImplInCallContext/2; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -400,6 +400,18 @@ class CastNode extends ExprNode { | |||
| 400 | 400 | } | |
| 401 | 401 | } | |
| 402 | 402 | ||
| 403 | + /** Holds if `n1` is the qualifier of a call to `clone()` and `n2` is the result. */ | ||
| 404 | + predicate cloneStep(Node n1, Node n2) { | ||
| 405 | + exists(MethodCall mc | | ||
| 406 | + mc.getMethod() instanceof CloneMethod and | ||
| 407 | + n1 = getInstanceArgument(mc) and | ||
| 408 | + n2.asExpr() = mc | ||
| 409 | + ) | ||
| 410 | + } | ||
| 411 | + | ||
| 412 | + bindingset[node1, node2] | ||
| 413 | + predicate validParameterAliasStep(Node node1, Node node2) { not cloneStep(node1, node2) } | ||
| 414 | + | ||
| 403 | 415 | private newtype TDataFlowCallable = | |
| 404 | 416 | TSrcCallable(Callable c) or | |
| 405 | 417 | TSummarizedCallable(SummarizedCallable c) or | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -258,6 +258,8 @@ private predicate simpleLocalFlowStep0(Node node1, Node node2, string model) { | |||
| 258 | 258 | model = "ValuePreservingMethod" | |
| 259 | 259 | ) | |
| 260 | 260 | or | |
| 261 | + cloneStep(node1, node2) and model = "CloneStep" | ||
| 262 | + or | ||
| 261 | 263 | FlowSummaryImpl::Private::Steps::summaryLocalStep(node1.(FlowSummaryNode).getSummaryNode(), | |
| 262 | 264 | node2.(FlowSummaryNode).getSummaryNode(), true, model) | |
| 263 | 265 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments