Skip to content

Commit e99a040

Browse files
authored
implement review suggestions
1 parent 8b44d5c commit e99a040

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Operand.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ class ThisArgumentOperand extends ArgumentOperand {
416416
// in most cases the def location makes more sense, but in some corner cases it
417417
// does not have a location: in those cases we fall back to the use location
418418
override Language::Location getLocation() {
419-
if exists(Language::Location loc | loc = this.getAnyDef().getLocation())
420-
then result = this.getAnyDef().getLocation()
421-
else result = this.getUse().getLocation()
419+
result = this.getAnyDef().getLocation()
420+
or
421+
not exists(this.getAnyDef().getLocation()) and
422+
result = this.getUse().getLocation()
422423
}
423424
}
424425

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Operand.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ class ThisArgumentOperand extends ArgumentOperand {
416416
// in most cases the def location makes more sense, but in some corner cases it
417417
// does not have a location: in those cases we fall back to the use location
418418
override Language::Location getLocation() {
419-
if exists(Language::Location loc | loc = this.getAnyDef().getLocation())
420-
then result = this.getAnyDef().getLocation()
421-
else result = this.getUse().getLocation()
419+
result = this.getAnyDef().getLocation()
420+
or
421+
not exists(this.getAnyDef().getLocation()) and
422+
result = this.getUse().getLocation()
422423
}
423424
}
424425

cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Operand.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ class ThisArgumentOperand extends ArgumentOperand {
416416
// in most cases the def location makes more sense, but in some corner cases it
417417
// does not have a location: in those cases we fall back to the use location
418418
override Language::Location getLocation() {
419-
if exists(Language::Location loc | loc = this.getAnyDef().getLocation())
420-
then result = this.getAnyDef().getLocation()
421-
else result = this.getUse().getLocation()
419+
result = this.getAnyDef().getLocation()
420+
or
421+
not exists(this.getAnyDef().getLocation()) and
422+
result = this.getUse().getLocation()
422423
}
423424
}
424425

csharp/ql/src/experimental/ir/implementation/raw/Operand.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ class ThisArgumentOperand extends ArgumentOperand {
416416
// in most cases the def location makes more sense, but in some corner cases it
417417
// does not have a location: in those cases we fall back to the use location
418418
override Language::Location getLocation() {
419-
if exists(Language::Location loc | loc = this.getAnyDef().getLocation())
420-
then result = this.getAnyDef().getLocation()
421-
else result = this.getUse().getLocation()
419+
result = this.getAnyDef().getLocation()
420+
or
421+
not exists(this.getAnyDef().getLocation()) and
422+
result = this.getUse().getLocation()
422423
}
423424
}
424425

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Operand.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,10 @@ class ThisArgumentOperand extends ArgumentOperand {
416416
// in most cases the def location makes more sense, but in some corner cases it
417417
// does not have a location: in those cases we fall back to the use location
418418
override Language::Location getLocation() {
419-
if exists(Language::Location loc | loc = this.getAnyDef().getLocation())
420-
then result = this.getAnyDef().getLocation()
421-
else result = this.getUse().getLocation()
419+
result = this.getAnyDef().getLocation()
420+
or
421+
not exists(this.getAnyDef().getLocation()) and
422+
result = this.getUse().getLocation()
422423
}
423424
}
424425

0 commit comments

Comments
 (0)