Skip to content

Commit b3cbdb5

Browse files
committed
C++: Add QLDoc to TRange.
1 parent c481be8 commit b3cbdb5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cpp/ql/lib/semmle/code/cpp/controlflow/IRGuards.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ module GuardsInput implements SharedGuards::InputSig<Cpp::Location, Instruction,
3131
}
3232

3333
private newtype TConstantValue =
34+
// This is slightly abusing the shared guards library. Using
35+
// `TRange(40, 50)` to model a constant expression in the program such as
36+
// the literal "42" causes the shared guards library to make incorrect
37+
// inferences.
38+
// However, since we only use them to model `CaseConstant::asConstantValue`
39+
// this does not cause any wrong inferences (at least for now).
3440
TRange(string minValue, string maxValue) {
3541
minValue != maxValue and
3642
exists(EdgeKind::caseEdge(minValue, maxValue))

0 commit comments

Comments
 (0)