Skip to content

Commit d6fb29d

Browse files
committed
C/C++: Disable constant folding of address-vs-null comparisons
1 parent a40719b commit d6fb29d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedElement.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ private predicate ignoreConstantValue(Operation op) {
6868
* means to express those as QL values.
6969
*/
7070
predicate isIRConstant(Expr expr) {
71+
not expr = any(IfStmt ifstmt).getCondition().getFullyConverted() and
7172
exists(expr.getValue()) and
7273
// We avoid constant folding certain operations since it's often useful to
7374
// mark one of those as a source in dataflow, and if the operation is

0 commit comments

Comments
 (0)