C++: Fix getTempVariable join order in IR

This join order seems to have broken so it took forever on
wireshark/wireshark.
This commit is contained in:
Jonas Jensen
2019-12-10 13:43:36 +01:00
parent 1c2f36930d
commit 7c151644f5

View File

@@ -684,9 +684,17 @@ abstract class TranslatedElement extends TTranslatedElement {
* Gets the temporary variable generated by this element with tag `tag`.
*/
final IRTempVariable getTempVariable(TempVariableTag tag) {
result.getAST() = getAST() and
result.getTag() = tag and
hasTempVariable(tag, _)
exists(Locatable ast |
result.getAST() = ast and
result.getTag() = tag and
hasTempVariableAndAST(tag, ast)
)
}
pragma[noinline]
private predicate hasTempVariableAndAST(TempVariableTag tag, Locatable ast) {
hasTempVariable(tag, _) and
ast = getAST()
}
/**