Skip to content

C++ Test PR: try replacing AST dataflow with IR dataflow in 1.24 #4526

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

Draft
wants to merge 1 commit into
base: rc/1.24
Choose a base branch
from
Draft
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
16 changes: 7 additions & 9 deletions cpp/ql/src/semmle/code/cpp/dataflow/DataFlow.qll
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/**
* Provides a library for local (intra-procedural) and global (inter-procedural)
* data flow analysis: deciding whether data can flow from a _source_ to a
* _sink_.
* _sink_. This library differs from the one in `semmle.code.cpp.dataflow` in that
* this library uses the IR (Intermediate Representation) library, which provides
* a more precise semantic representation of the program, whereas the other dataflow
* library uses the more syntax-oriented ASTs. This library should provide more accurate
* results than the AST-based library in most scenarios.
*
* Unless configured otherwise, _flow_ means that the exact value of
* the source may reach the sink. We do not track flow across pointer
* dereferences or array indexing. To track these types of flow, where the
* exact value may not be preserved, import
* `semmle.code.cpp.dataflow.TaintTracking`.
* dereferences or array indexing.
*
* To use global (interprocedural) data flow, extend the class
* `DataFlow::Configuration` as documented on that class. To use local
Expand All @@ -17,8 +19,4 @@
* `DataFlow::Node`.
*/

import cpp

module DataFlow {
import semmle.code.cpp.dataflow.internal.DataFlowImpl
}
import semmle.code.cpp.ir.dataflow.DataFlow
8 changes: 2 additions & 6 deletions cpp/ql/src/semmle/code/cpp/dataflow/DataFlow2.qll
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
* `DataFlow2::Configuration`, a `DataFlow3::Configuration`, or a
* `DataFlow4::Configuration`.
*
* See `semmle.code.cpp.dataflow.DataFlow` for the full documentation.
* See `semmle.code.cpp.ir.dataflow.DataFlow` for the full documentation.
*/

import cpp

module DataFlow2 {
import semmle.code.cpp.dataflow.internal.DataFlowImpl2
}
import semmle.code.cpp.ir.dataflow.DataFlow2
8 changes: 2 additions & 6 deletions cpp/ql/src/semmle/code/cpp/dataflow/DataFlow3.qll
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
* `DataFlow2::Configuration`, a `DataFlow3::Configuration`, or a
* `DataFlow4::Configuration`.
*
* See `semmle.code.cpp.dataflow.DataFlow` for the full documentation.
* See `semmle.code.cpp.ir.dataflow.DataFlow` for the full documentation.
*/

import cpp

module DataFlow3 {
import semmle.code.cpp.dataflow.internal.DataFlowImpl3
}
import semmle.code.cpp.ir.dataflow.DataFlow3
8 changes: 2 additions & 6 deletions cpp/ql/src/semmle/code/cpp/dataflow/DataFlow4.qll
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
* `DataFlow2::Configuration`, a `DataFlow3::Configuration`, or a
* `DataFlow4::Configuration`.
*
* See `semmle.code.cpp.dataflow.DataFlow` for the full documentation.
* See `semmle.code.cpp.ir.dataflow.DataFlow` for the full documentation.
*/

import cpp

module DataFlow4 {
import semmle.code.cpp.dataflow.internal.DataFlowImpl4
}
import semmle.code.cpp.ir.dataflow.DataFlow4
39 changes: 0 additions & 39 deletions cpp/ql/src/semmle/code/cpp/dataflow/RecursionPrevention.qll

This file was deleted.

13 changes: 1 addition & 12 deletions cpp/ql/src/semmle/code/cpp/dataflow/TaintTracking.qll
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,4 @@
* `TaintTracking::localTaintStep` with arguments of type `DataFlow::Node`.
*/

import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow2

module TaintTracking {
import semmle.code.cpp.dataflow.internal.tainttracking1.TaintTrackingImpl
private import semmle.code.cpp.dataflow.TaintTracking2

/**
* DEPRECATED: Use TaintTracking2::Configuration instead.
*/
deprecated class Configuration2 = TaintTracking2::Configuration;
}
import semmle.code.cpp.ir.dataflow.TaintTracking
7 changes: 3 additions & 4 deletions cpp/ql/src/semmle/code/cpp/dataflow/TaintTracking2.qll
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
* `TaintTracking::Configuration` class extends `DataFlow::Configuration`, and
* `TaintTracking2::Configuration` extends `DataFlow2::Configuration`.
*
* See `semmle.code.cpp.dataflow.TaintTracking` for the full documentation.
* See `semmle.code.cpp.ir.dataflow.TaintTracking` for the full documentation.
*/
module TaintTracking2 {
import semmle.code.cpp.dataflow.internal.tainttracking2.TaintTrackingImpl
}

import semmle.code.cpp.ir.dataflow.TaintTracking2
78 changes: 0 additions & 78 deletions cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowDispatch.qll

This file was deleted.

Loading