Skip to content

Commit 222e6f0

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: undo temp revert of neutral filtering
1 parent 128a6a3 commit 222e6f0

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

java/ql/lib/semmle/code/java/dataflow/FlowSummary.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ class SummarizedCallableBase extends TSummarizedCallableBase {
171171

172172
class SummarizedCallable = Impl::Public::SummarizedCallable;
173173

174-
// class NeutralCallable = Impl::Public::NeutralCallable;
174+
class NeutralCallable = Impl::Public::NeutralCallable;
175+
175176
/**
176177
* An adapter class to add the flow summaries specified on `SyntheticCallable`
177178
* to `SummarizedCallable`.

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ private module DispatchImpl {
1111
private predicate hasHighConfidenceTarget(Call c) {
1212
exists(SummarizedCallable sc | sc.getACall() = c and not sc.isAutoGenerated())
1313
or
14-
// exists(NeutralCallable nc | nc.getACall() = c and nc.isManual())
15-
// or
14+
exists(NeutralCallable nc | nc.getACall() = c and nc.isManual())
15+
or
1616
exists(Callable srcTgt |
1717
srcTgt = VirtualDispatch::viableCallable(c) and
1818
not VirtualDispatch::lowConfidenceDispatchTarget(c, srcTgt)

java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,12 @@ private VirtualMethodAccess objectToString(ObjNode n) {
236236
result.getQualifier() = n.asExpr() and sink(n)
237237
}
238238

239-
// /**
240-
// * Holds if `ma` is an `Object.toString()` call taking possibly improved type
241-
// * bounds into account.
242-
// */
243-
// predicate objectToStringCall(VirtualMethodAccess ma) { ma = objectToString(_) }
239+
/**
240+
* Holds if `ma` is an `Object.toString()` call taking possibly improved type
241+
* bounds into account.
242+
*/
243+
predicate objectToStringCall(VirtualMethodAccess ma) { ma = objectToString(_) }
244+
244245
/**
245246
* Holds if the qualifier of the `Object.toString()` call `ma` might have type `t`.
246247
*/

java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ private module Dispatch {
9393
exists(RefType t | qualUnionType(ma, t, false) |
9494
lowConfidenceDispatchType(t.getSourceDeclaration())
9595
)
96-
) //and
97-
//not ObjFlow::objectToStringCall(ma)
96+
) and
97+
not ObjFlow::objectToStringCall(ma)
9898
}
9999

100100
private predicate lowConfidenceDispatchType(SrcRefType t) {

0 commit comments

Comments
 (0)