Skip to content

Commit 01b789d

Browse files
committed
C#: Fixup of locations to avoid antijoin.
1 parent e0d6fdb commit 01b789d

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

csharp/ql/lib/semmle/code/csharp/Callable.qll

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,7 @@ class Method extends Callable, Virtualizable, Attributable, @method {
266266
}
267267

268268
override Location getALocation() {
269-
exists(Method m | m = this.getUnboundDeclaration() |
270-
method_location(m, result)
271-
or
272-
not method_location(m, _) and result instanceof EmptyLocation
273-
)
269+
exists(Method m | m = this.getUnboundDeclaration() | method_location(m, result))
274270
}
275271

276272
/** Holds if this method is an extension method. */
@@ -363,11 +359,7 @@ class Constructor extends Callable, Member, Attributable, @constructor {
363359

364360
override Constructor getUnboundDeclaration() { constructors(this, _, _, result) }
365361

366-
override Location getALocation() {
367-
constructor_location(this, result)
368-
or
369-
not constructor_location(this, _) and result instanceof EmptyLocation
370-
}
362+
override Location getALocation() { constructor_location(this, result) }
371363

372364
override predicate fromSource() { Member.super.fromSource() and not this.isCompilerGenerated() }
373365

csharp/ql/lib/semmle/code/csharp/Variable.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,7 @@ class Parameter extends LocalScopeVariable, Attributable, TopLevelExprParent, @p
213213
params(this, _, getTypeRef(result), _, _, _, _)
214214
}
215215

216-
override Location getALocation() {
217-
param_location(this, result)
218-
or
219-
not param_location(this, _) and result instanceof EmptyLocation
220-
}
216+
override Location getALocation() { param_location(this, result) }
221217

222218
override string toString() { result = this.getName() }
223219

0 commit comments

Comments
 (0)