File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
cpp/ql/src/experimental/semmle/code/cpp/models/interfaces Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -56,3 +56,23 @@ abstract class SimpleRangeAnalysisExpr extends Expr {
5656}
5757
5858import SimpleRangeAnalysisInternal
59+
60+ /**
61+ * This class exists to prevent the QL front end from emitting compile errors
62+ * inside `SimpleRangeAnalysis.qll` about certain conjuncts being empty
63+ * because the overrides of `SimpleRangeAnalysisExpr` that happen to be in
64+ * scope do not make use of every feature it offers.
65+ */
66+ private class Empty extends SimpleRangeAnalysisExpr {
67+ Empty ( ) {
68+ // This predicate is complicated enough that the QL type checker doesn't
69+ // see it as empty but simple enough that the optimizer should.
70+ this = this and none ( )
71+ }
72+
73+ override float getLowerBounds ( ) { none ( ) }
74+
75+ override float getUpperBounds ( ) { none ( ) }
76+
77+ override predicate dependsOnChild ( Expr child ) { none ( ) }
78+ }
You can’t perform that action at this time.
0 commit comments