Skip to content

Commit f31709f

Browse files
committed
C++: Make comment more clear.
1 parent a7712b6 commit f31709f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

cpp/ql/src/experimental/Likely Bugs/OverrunWriteProductFlow.ql

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,12 @@ module ValidState {
159159
// For a dataflow sink any `value` that is strictly smaller than the delta
160160
// needs to be a valid flow-state. That is, for a snippet like:
161161
// ```
162-
// p = new char[size];
162+
// p = b ? new char[size] : new char[size + 1];
163163
// memset(p, 0, size + 2);
164164
// ```
165-
// the valid flow-states at the `memset` must include `0` since the flow-state
166-
// at the source is `0`. Similarly, for an example such as:
167-
// ```
168-
// p = new char[size + 1];
169-
// memset(p, 0, size + 2);
170-
// ```
171-
// the flow-state at the `memset` must include `1` since `1` is the flow-state
172-
// after the source.
165+
// the valid flow-states at the `memset` must include set set `{0, 1}` since the
166+
// flow-state at `new char[size]` is `0`, and the flow-state at `new char[size + 1]`
167+
// is `1`.
173168
//
174169
// So we find a valid flow-state at the sink's predecessor, and use the definition
175170
// of our sink predicate to compute the valid flow-states at the sink.

0 commit comments

Comments
 (0)