@@ -42,9 +42,9 @@ predicate hasSize(HeuristicAllocationExpr alloc, DataFlow::Node n, int state) {
42
42
* ```
43
43
* In this case, the sink pair identified by the product flow library (without any additional barriers)
44
44
* would be `(p, n)` (where `n` is the `n` in `p[n]`), because there exists a pointer-arithmetic
45
- * instruction `pai` such that:
46
- * 1. The left-hand of `pai` flows from the allocation , and
47
- * 2. The right-hand of `pai` is non-strictly upper bounded by ` n` ( where `n` is the `n` in `p[n]`)
45
+ * instruction `pai = a + b ` such that:
46
+ * 1. the allocation flows to `a` , and
47
+ * 2. `b <= n` where `n` is the `n` in `p[n]`
48
48
* but because there's a strict comparison that compares `n` against the size of the allocation this
49
49
* snippet is fine.
50
50
*/
@@ -147,8 +147,8 @@ private module InterestingPointerAddInstruction {
147
147
}
148
148
149
149
/**
150
- * A product-flow configuration for flow from an (allocation, size) pair to a
151
- * pointer-arithmetic operation that is non-strictly upper-bounded by ` allocation + size`.
150
+ * A product-flow configuration for flow from an ` (allocation, size)` pair to a
151
+ * pointer-arithmetic operation `pai` such that `pai <= allocation + size`.
152
152
*
153
153
* The goal of this query is to find patterns such as:
154
154
* ```cpp
@@ -207,7 +207,7 @@ private module Config implements ProductFlow::StateConfigSig {
207
207
private module AllocToInvalidPointerFlow = ProductFlow:: GlobalWithState< Config > ;
208
208
209
209
/**
210
- * Holds if `pai` is non-strictly upper bounded by `sink2 + delta` and `sink1 ` is the
210
+ * Holds if `pai` is non-strictly upper bounded by `sizeSink + delta` and `allocSink ` is the
211
211
* left operand of the pointer-arithmetic operation.
212
212
*
213
213
* For example in,
@@ -216,8 +216,8 @@ private module AllocToInvalidPointerFlow = ProductFlow::GlobalWithState<Config>;
216
216
* ```
217
217
* We will have:
218
218
* - `pai` is `p + (size + 1)`,
219
- * - `sink1 ` is `p`
220
- * - `sink2 ` is `size`
219
+ * - `allocSink ` is `p`
220
+ * - `sizeSink ` is `size`
221
221
* - `delta` is `1`.
222
222
*/
223
223
pragma [ nomagic]
@@ -237,9 +237,9 @@ private predicate pointerAddInstructionHasBounds0(
237
237
}
238
238
239
239
/**
240
- * Holds if `allocation` flows to `sink1 ` and `sink1 ` represents the left-hand
241
- * side of the pointer-arithmetic instruction `pai`, and the right-hand side of `pai`
242
- * is non-strictly upper bounded by the size of `alllocation` + ` delta`.
240
+ * Holds if `allocation` flows to `allocSink ` and `allocSink ` represents the left operand
241
+ * of the pointer-arithmetic instruction `pai = a + b` (i.e., `allocSink = a`), and
242
+ * `b <= allocation + delta`.
243
243
*/
244
244
pragma [ nomagic]
245
245
predicate pointerAddInstructionHasBounds (
0 commit comments