Skip to content

Commit 10de931

Browse files
committed
C++: Decrease largeVariable cut-off to 100k
This 10x lower cut-off has on at least one snapshot made it possible to compute AST data flow where it was infeasible before. Also fix an integer overflow that happened in practice on at least one snapshot and prevented the cut-off from being applied.
1 parent 7c3ea0e commit 10de931

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

Lines changed: 2 additions & 1 deletion
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)