Skip to content

Commit aed14f2

Browse files
committed
C++: Don't insert loads for constants.
1 parent b575747 commit aed14f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,9 @@ predicate hasTranslatedLoad(Expr expr) {
415415
not ignoreExpr(expr) and
416416
not isNativeCondition(expr) and
417417
not isFlexibleCondition(expr) and
418-
not ignoreLoad(expr)
418+
not ignoreLoad(expr) and
419+
// don't insert a load since we'll just substitute the constant value.
420+
not isIRConstant(expr)
419421
}
420422

421423
/**

0 commit comments

Comments
 (0)