Skip to content

Dataflow: Minor visibility cleanup #10575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
10 changes: 3 additions & 7 deletions cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
10 changes: 3 additions & 7 deletions cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
10 changes: 3 additions & 7 deletions cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
10 changes: 3 additions & 7 deletions cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,9 @@ private predicate hasSinkCallCtx(Configuration config) {
}

private module Stage1 implements StageSig {
class ApApprox = Unit;

class Ap = Unit;

class ApOption = Unit;

class Cc = boolean;
private class Cc = boolean;

/* Begin: Stage 1 logic. */
/**
Expand All @@ -613,7 +609,7 @@ private module Stage1 implements StageSig {
* The Boolean `cc` records whether the node is reached through an
* argument in a call.
*/
predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
private predicate fwdFlow(NodeEx node, Cc cc, Configuration config) {
sourceNode(node, _, config) and
if hasSourceCallCtx(config) then cc = true else cc = false
or
Expand Down Expand Up @@ -753,7 +749,7 @@ private module Stage1 implements StageSig {
* the enclosing callable in order to reach a sink.
*/
pragma[nomagic]
predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
private predicate revFlow(NodeEx node, boolean toReturn, Configuration config) {
revFlow0(node, toReturn, config) and
fwdFlow(node, config)
}
Expand Down
Loading