Skip to content

Commit 9868f6a

Browse files
committed
C#: Fix some bad join orders.
1 parent 7811a61 commit 9868f6a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ module Ssa {
605605

606606
override Element getElement() { result = this.getParameter() }
607607

608-
override string toString() { result = "SSA param(" + this.getParameter() + ")" }
608+
override string toString() {
609+
result = "SSA param(" + pragma[only_bind_out](this.getParameter()) + ")"
610+
}
609611

610612
override Location getLocation() {
611613
not NearestLocation<NearestLocationInput>::nearestLocation(this, _, _) and

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ private class Argument extends Expr {
748748
*
749749
* `postUpdate` indicates whether the store targets a post-update node.
750750
*/
751+
pragma[nomagic]
751752
private predicate fieldOrPropertyStore(ContentSet c, Expr src, Expr q, boolean postUpdate) {
752753
exists(FieldOrProperty f |
753754
c = f.getContentSet() and
@@ -795,9 +796,9 @@ private predicate fieldOrPropertyStore(ContentSet c, Expr src, Expr q, boolean p
795796
// Tuple element, `(..., src, ...)` `f` is `ItemX` of tuple `q`
796797
exists(TupleExpr te, int i |
797798
te = q and
798-
src = te.getArgument(i) and
799+
src = te.getArgument(pragma[only_bind_into](i)) and
799800
te.isConstruction() and
800-
f = q.getType().(TupleType).getElement(i) and
801+
f = q.getType().(TupleType).getElement(pragma[only_bind_into](i)) and
801802
postUpdate = false
802803
)
803804
)

csharp/ql/src/Likely Bugs/UncheckedCastInEquals.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import csharp
1414
import semmle.code.csharp.frameworks.System
1515

16+
pragma[nomagic]
1617
predicate nodeBeforeParameterAccess(ControlFlowNode node) {
1718
exists(EqualsMethod equals | equals.getBody().getControlFlowNode() = node)
1819
or

0 commit comments

Comments
 (0)