Skip to content

Commit 7c15164

Browse files
committed
C++: Fix getTempVariable join order in IR
This join order seems to have broken so it took forever on wireshark/wireshark.
1 parent 1c2f369 commit 7c15164

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,17 @@ abstract class TranslatedElement extends TTranslatedElement {
684684
* Gets the temporary variable generated by this element with tag `tag`.
685685
*/
686686
final IRTempVariable getTempVariable(TempVariableTag tag) {
687-
result.getAST() = getAST() and
688-
result.getTag() = tag and
689-
hasTempVariable(tag, _)
687+
exists(Locatable ast |
688+
result.getAST() = ast and
689+
result.getTag() = tag and
690+
hasTempVariableAndAST(tag, ast)
691+
)
692+
}
693+
694+
pragma[noinline]
695+
private predicate hasTempVariableAndAST(TempVariableTag tag, Locatable ast) {
696+
hasTempVariable(tag, _) and
697+
ast = getAST()
690698
}
691699

692700
/**

0 commit comments

Comments
 (0)