Skip to content

Commit bc58cbe

Browse files
committed
C++: Implement ContentApprox
1 parent 0c2eee2 commit bc58cbe

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,13 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
551551
*/
552552
predicate allowParameterReturnInSelf(ParameterNode p) { none() }
553553

554+
/** An approximated `Content`. */
555+
class ContentApprox = Unit;
556+
557+
/** Gets an approximated value for content `c`. */
558+
pragma[inline]
559+
ContentApprox getContentApprox(Content c) { any() }
560+
554561
private class MyConsistencyConfiguration extends Consistency::ConsistencyConfiguration {
555562
override predicate argHasPostUpdateExclude(ArgumentNode n) {
556563
// The rules for whether an IR argument gets a post-update node are too

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,13 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
296296
*/
297297
predicate allowParameterReturnInSelf(ParameterNode p) { none() }
298298

299+
/** An approximated `Content`. */
300+
class ContentApprox = Unit;
301+
302+
/** Gets an approximated value for content `c`. */
303+
pragma[inline]
304+
ContentApprox getContentApprox(Content c) { any() }
305+
299306
private class MyConsistencyConfiguration extends Consistency::ConsistencyConfiguration {
300307
override predicate argHasPostUpdateExclude(ArgumentNode n) {
301308
// Is the null pointer (or something that's not really a pointer)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,13 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
400400
*/
401401
predicate allowParameterReturnInSelf(ParameterNode p) { none() }
402402

403+
/** An approximated `Content`. */
404+
class ContentApprox = Unit;
405+
406+
/** Gets an approximated value for content `c`. */
407+
pragma[inline]
408+
ContentApprox getContentApprox(Content c) { any() }
409+
403410
private class MyConsistencyConfiguration extends Consistency::ConsistencyConfiguration {
404411
override predicate argHasPostUpdateExclude(ArgumentNode n) {
405412
// The rules for whether an IR argument gets a post-update node are too

0 commit comments

Comments
 (0)