Skip to content

Commit

Permalink
C++: Fixes for internals that are now private.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffw0 committed Apr 10, 2024
1 parent 41ce4ff commit 959300f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DataFlowCallable defaultViableCallable(DataFlowCall call) {
)
or
// Virtual dispatch
result = TSourceCallable(call.(VirtualDispatch::DataSensitiveCall).resolve())
result.asSourceCallable() = call.(VirtualDispatch::DataSensitiveCall).resolve()
}

/**
Expand Down Expand Up @@ -284,11 +284,8 @@ DataFlowCallable viableImplInCallContext(DataFlowCall call, DataFlowCall ctx) {
exists(int i, DataFlowCallable f |
mayBenefitFromCallContext(pragma[only_bind_into](call), f, i) and
f = ctx.getStaticCallTarget() and
result =
TSourceCallable(ctx.getArgument(i)
.getUnconvertedResultExpression()
.(FunctionAccess)
.getTarget())
result.asSourceCallable() =
ctx.getArgument(i).getUnconvertedResultExpression().(FunctionAccess).getTarget()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ class DataFlowCallable extends TDataFlowCallable {
* unmodeled flows or duplicate paths), and includes variables (for reasons
* explained in `DataFlowCallable`).
*/
private class SourceCallable extends DataFlowCallable, TSourceCallable {
class SourceCallable extends DataFlowCallable, TSourceCallable {
Cpp::Declaration decl;

SourceCallable() { this = TSourceCallable(decl) }
Expand All @@ -1078,7 +1078,7 @@ private class SourceCallable extends DataFlowCallable, TSourceCallable {
* models-as-data models as a place to contain the corresponding
* `FlowSummaryNode`s.
*/
private class SummarizedCallable extends DataFlowCallable, TSummarizedCallable {
class SummarizedCallable extends DataFlowCallable, TSummarizedCallable {
FlowSummaryImpl::Public::SummarizedCallable sc;

SummarizedCallable() { this = TSummarizedCallable(sc) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ private import semmle.code.cpp.ir.dataflow.internal.DataFlowUtil

query predicate summaryCalls(SummaryCall c) { any() }

query predicate summarizedCallables(DataFlowCallable c) { c = TSummarizedCallable(_) }
query predicate summarizedCallables(SummarizedCallable c) { any() }

query predicate sourceCallables(DataFlowCallable c) {
c = TSourceCallable(_) and
c.getLocation().getFile().toString() != ""
}
query predicate sourceCallables(SourceCallable c) { c.getLocation().getFile().toString() != "" }

0 comments on commit 959300f

Please sign in to comment.