Skip to content

Commit 43e2017

Browse files
committed
Rust: Fix bad join
Before ``` Evaluated relational algebra for predicate _ElementImpl::Impl::MacroExpansion::isAttributeMacroExpansionSourceLocation/2#3429148c_Locatable::Lo__#antijoin_rhs@9f4aa4rk with tuple counts: 5127263380 ~4% {3} r1 = JOIN `_AstNodeImpl::Impl::AstNode#22e758cf_ElementImpl::Impl::MacroExpansion::getATokenTreeNode/1#a2df59a3__#shared` WITH `ElementImpl::Impl::MacroExpansion::isAttributeMacroExpansionSourceLocation/2#3429148c` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.0 305226 ~0% {2} | JOIN WITH `Locatable::Locatable.getLocation/0#dispred#f3f7e2b2` ON FIRST 2 OUTPUT Lhs.0, Lhs.2 return r1 ``` (No After; the predicate is no longer generated)
1 parent a5d9cb1 commit 43e2017

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rust/ql/lib/codeql/rust/elements/internal/ElementImpl.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ module Impl {
9999
*/
100100
cached
101101
predicate isFromMacroExpansion(AstNode n) {
102-
exists(AstNode macro |
102+
exists(AstNode macro, Location l |
103103
macro = getImmediatelyEnclosingMacroInvocation(n) and
104104
not n = getATokenTreeNode(macro) and
105-
not isAttributeMacroExpansionSourceLocation(macro, n.getLocation())
105+
l = n.getLocation() and
106+
not isAttributeMacroExpansionSourceLocation(macro, l)
106107
)
107108
or
108109
isFromMacroExpansion(pragma[only_bind_into](getImmediatelyEnclosingMacroInvocation(n)))

0 commit comments

Comments
 (0)