Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 928bdba

Browse files
committed
C++: Change import order for stable cache checksum
Without this fix, running the full LGTM suite would get the IR evaluated twice. That's because we have multiple IPA types and constructors with the same name (like `TInstruction` and `MkIRFunction`), and the QL compiler chooses how to disambiguate those names differently depending on import order. I've tested that the IR is only evaluated once now by running the whole suite on a tiny project (jbj/magicrescue) and looking at the output of perl -ne 'print if /^RESULTS IN:/ .. /^\[/ and not /^\[/' runSnapshotQueries-debug.log | sort |uniq -c |sort -n |less
1 parent da566a4 commit 928bdba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
*/
44

55
private import cpp
6+
// The `ValueNumbering` library has to be imported right after `cpp` to ensure
7+
// that the cached IR gets the same checksum here as it does in queries that use
8+
// `ValueNumbering` without `DataFlow`.
9+
private import semmle.code.cpp.ir.ValueNumbering
610
private import semmle.code.cpp.ir.IR
711
private import semmle.code.cpp.controlflow.IRGuards
8-
private import semmle.code.cpp.ir.ValueNumbering
912
private import semmle.code.cpp.models.interfaces.DataFlow
1013

1114
private newtype TIRDataFlowNode =

0 commit comments

Comments
 (0)