Skip to content

Commit 648acc3

Browse files
committed
C++: Prevent IR re-evaluation by importing GVN.
1 parent fd4f8c5 commit 648acc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/ql/src/Likely Bugs/OO/UnsafeUseOfThis.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
* security
1313
*/
1414

15-
import semmle.code.cpp.ir.IR
1615
import cpp
16+
// We don't actually use the global value numbering library in this query, but without it we end up
17+
// recomputing the IR.
18+
private import semmle.code.cpp.valuenumbering.GlobalValueNumbering
19+
private import semmle.code.cpp.ir.IR
1720

1821
bindingset[n, result]
1922
int unbind(int n) { result >= n and result <= n }

0 commit comments

Comments
 (0)