Skip to content

Commit bf4a84b

Browse files
committed
C++: Drive-by: Add forgotten disjuncts involving '__builtin_expect'.
1 parent e6cd27a commit bf4a84b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,8 @@ private module Cached {
12921292
compares_lt(test.(LogicalNotValueNumber).getUnary(), left, right, k, isLt, dual)
12931293
)
12941294
or
1295+
compares_lt(test.(BuiltinExpectCallValueNumber).getCondition(), left, right, k, isLt, value)
1296+
or
12951297
// See argument for why this is correct in compares_eq
12961298
exists(Operand l, BooleanValue bv |
12971299
unary_compares_eq(test, l, 0, bv.getValue().booleanNot(), value) and
@@ -1318,6 +1320,8 @@ private module Cached {
13181320
k = k1 + k2
13191321
)
13201322
or
1323+
compares_lt(test.(BuiltinExpectCallValueNumber).getCondition(), op, k, isLt, value)
1324+
or
13211325
// See argument for why this is correct in compares_eq
13221326
exists(Operand l, BooleanValue bv |
13231327
unary_compares_eq(test, l, 0, bv.getValue().booleanNot(), value) and

0 commit comments

Comments
 (0)