Skip to content

Commit 9897a81

Browse files
authored
Merge pull request github#4677 from jbj/largeVariable-overflow
C++: Decrease largeVariable cut-off to 100k
2 parents 4d89838 + 10de931 commit 9897a81

File tree

1 file changed

+2
-1
lines changed
  • cpp/ql/src/semmle/code/cpp/dataflow/internal

1 file changed

+2
-1
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/FlowVar.qll

+2-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ module FlowVar_internal {
620620
private predicate largeVariable(Variable v, int liveBlocks, int defs) {
621621
liveBlocks = strictcount(SubBasicBlock sbb | variableLiveInSBB(sbb, v)) and
622622
defs = strictcount(SubBasicBlock sbb | exists(TBlockVar(sbb, v))) and
623-
liveBlocks * defs > 1000000
623+
// Convert to float to avoid int overflow (32-bit two's complement)
624+
liveBlocks.(float) * defs.(float) > 100000.0
624625
}
625626

626627
/**

0 commit comments

Comments
 (0)