mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Fixes
This commit is contained in:
@@ -85,9 +85,8 @@ predicate callsMethodOnUnknownClassWithSelf(Function meth, string name) {
|
||||
}
|
||||
|
||||
predicate missingCallToSuperclassMethod(Class base, Function shouldCall, string name) {
|
||||
base.getName() = name and
|
||||
shouldCall.getName() = name and
|
||||
base = getADirectSuperclass*(base.getScope()) and
|
||||
shouldCall.getScope() = getADirectSuperclass+(base) and
|
||||
not shouldCall = getASuperCallTargetFromClass(base, base, name) and
|
||||
nonTrivial(shouldCall) and
|
||||
// "Benefit of the doubt" - if somewhere in the chain we call an unknown superclass, assume all the necessary parent methods are called from it
|
||||
|
||||
@@ -38,7 +38,7 @@ where
|
||||
msg =
|
||||
"This class does not call $@ during destruction. ($@ may be missing a call to a base class __del__)"
|
||||
or
|
||||
not getDelMethod(base) and
|
||||
not exists(getDelMethod(base)) and
|
||||
possibleIssue.isNone() and
|
||||
msg =
|
||||
"This class does not call $@ during destruction. (The class lacks an __del__ method to ensure every base class __del__ is called.)"
|
||||
|
||||
@@ -21,8 +21,7 @@ where
|
||||
missingCallToSuperclassMethodRestricted(base, shouldCall, "__init__") and
|
||||
possiblyMissingSuper = getPossibleMissingSuperOption(base, shouldCall, "__init__") and
|
||||
(
|
||||
not possiblyMissingSuper.isNone() and
|
||||
possibleIssue = possiblyMissingSuper and
|
||||
possibleIssue.asSome() = possiblyMissingSuper.asSome() and
|
||||
msg =
|
||||
"This class does not call $@ during initialization. ($@ may be missing a call to super().__init__)"
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user