Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdc3d10

Browse files
committed
C++: QLDoc SummaryCall, SourceCallable and SummarizedCallable.
1 parent 49ef677 commit bdc3d10

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,11 @@ class DataFlowCallable extends TDataFlowCallable {
10271027
}
10281028

10291029
/**
1030-
* TODO: QLDoc.
1030+
* A source callable, conceptually, a function in the source code for the
1031+
* purpose of computing data flow. In practice this excludes functions that
1032+
* are summarized using models-as-data (as we don't want to create
1033+
* unmodelled flows or duplicate paths), and includes variables (for reasons
1034+
* explained in `DataFlowCallable`).
10311035
*/
10321036
private class SourceCallable extends DataFlowCallable, TSourceCallable {
10331037
Cpp::Declaration decl;
@@ -1040,7 +1044,9 @@ private class SourceCallable extends DataFlowCallable, TSourceCallable {
10401044
}
10411045

10421046
/**
1043-
* TODO: QLDoc.
1047+
* A summarized callable, that is, a function synthesized from one or more
1048+
* models-as-data models as a place to contain the corresponding
1049+
* `FlowSummaryNode`s.
10441050
*/
10451051
private class SummarizedCallable extends DataFlowCallable, TSummarizedCallable {
10461052
FlowSummaryImpl::Public::SummarizedCallable sc;
@@ -1147,7 +1153,14 @@ private class NormalCall extends DataFlowCall, TNormalCall {
11471153
/**
11481154
* A synthesized call inside a callable with a flow summary.
11491155
*
1150-
* TODO: example.
1156+
* For example, consider the function:
1157+
* ```
1158+
* int myFunction(int (*funPtr)());
1159+
* ```
1160+
* with an accompanying models-as-data flow summary involving `funPtr` (for
1161+
* example from `Argument[0].ReturnValue` to `ReturnValue`). A `SummaryCall`
1162+
* will be synthesized representing a call to `funPtr` inside `myFunction`,
1163+
* so that flow can be connected as described in the model.
11511164
*/
11521165
class SummaryCall extends DataFlowCall, TSummaryCall {
11531166
private FlowSummaryImpl::Public::SummarizedCallable c;

0 commit comments

Comments
 (0)