Skip to content

Commit 7e82595

Browse files
committed
Rust: Fix bad join
Before ``` Evaluated relational algebra for predicate MatchExprImpl::Impl::MatchExpr.getLastArm/0#dispred#24e5f4cf@9cf607tl with tuple counts: 660677 ~0% {4} r1 = SCAN `MatchExprImpl::Impl::MatchExpr.getArm/1#dispred#817de8a3` OUTPUT _, In.0, In.2, In.1 660677 ~0% {3} | REWRITE WITH Tmp.0 := 1, Out.0 := (Tmp.0 + In.3) KEEPING 3 5342095756 ~0% {3} | JOIN WITH `MatchArmList::Generated::MatchArmList.getNumberOfArms/0#dispred#9ad72f08_10#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2 96597 ~3% {2} | JOIN WITH `MatchExpr::Generated::MatchExpr.getMatchArmList/0#dispred#11f1a73e` ON FIRST 2 OUTPUT Lhs.0, Lhs.2 return r1 ``` After ``` Evaluated relational algebra for predicate MatchExprImpl::Impl::MatchExpr.getLastArm/0#dispred#24e5f4cf@9d7a92pu with tuple counts: 660677 ~0% {5} r1 = JOIN `MatchExprImpl::Impl::MatchExpr.getArm/1#344daffc` WITH `MatchExprImpl::Impl::MatchExpr.getNumberOfArms/0#ab0d8732` ON FIRST 1 OUTPUT Lhs.0, Lhs.1, Lhs.2, _, Rhs.1 {4} | REWRITE WITH Tmp.3 := 1, Out.3 := (In.4 - Tmp.3), TEST Out.3 = InOut.1 KEEPING 4 96597 ~3% {2} | SCAN OUTPUT In.0, In.2 return r1 ```
1 parent 5e4ce8f commit 7e82595

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module Impl {
3131
/**
3232
* Gets the `index`th arm of this match expression.
3333
*/
34+
pragma[nomagic]
3435
MatchArm getArm(int index) { result = this.getMatchArmList().getArm(index) }
3536

3637
/**
@@ -41,6 +42,7 @@ module Impl {
4142
/**
4243
* Gets the number of arms of this match expression.
4344
*/
45+
pragma[nomagic]
4446
int getNumberOfArms() { result = this.getMatchArmList().getNumberOfArms() }
4547

4648
/**

0 commit comments

Comments
 (0)