Skip to content

Commit 16b90a1

Browse files
Fixes
1 parent 1b4e2fe commit 16b90a1

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

python/ql/src/Classes/CallsToInitDel/MethodCallOrder.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ predicate callsMethodOnUnknownClassWithSelf(Function meth, string name) {
8585
}
8686

8787
predicate missingCallToSuperclassMethod(Class base, Function shouldCall, string name) {
88-
base.getName() = name and
8988
shouldCall.getName() = name and
90-
base = getADirectSuperclass*(base.getScope()) and
89+
shouldCall.getScope() = getADirectSuperclass+(base) and
9190
not shouldCall = getASuperCallTargetFromClass(base, base, name) and
9291
nonTrivial(shouldCall) and
9392
// "Benefit of the doubt" - if somewhere in the chain we call an unknown superclass, assume all the necessary parent methods are called from it

python/ql/src/Classes/CallsToInitDel/MissingCallToDel.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ where
3838
msg =
3939
"This class does not call $@ during destruction. ($@ may be missing a call to a base class __del__)"
4040
or
41-
not getDelMethod(base) and
41+
not exists(getDelMethod(base)) and
4242
possibleIssue.isNone() and
4343
msg =
4444
"This class does not call $@ during destruction. (The class lacks an __del__ method to ensure every base class __del__ is called.)"

python/ql/src/Classes/CallsToInitDel/MissingCallToInit.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ where
2121
missingCallToSuperclassMethodRestricted(base, shouldCall, "__init__") and
2222
possiblyMissingSuper = getPossibleMissingSuperOption(base, shouldCall, "__init__") and
2323
(
24-
not possiblyMissingSuper.isNone() and
25-
possibleIssue = possiblyMissingSuper and
24+
possibleIssue.asSome() = possiblyMissingSuper.asSome() and
2625
msg =
2726
"This class does not call $@ during initialization. ($@ may be missing a call to super().__init__)"
2827
or

0 commit comments

Comments
 (0)