mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
C++: Remove extra type check in AV Rule 82
These type checks were overlapping with `assignOperatorWithWrongType` is are no longer needed now that `assignOperatorWithWrongType` is improved. They were causing FPs and misleading error messages on uninstantiated templates.
This commit is contained in:
@@ -51,7 +51,6 @@ predicate dereferenceThis(Expr e) {
|
||||
* This includes functions whose body is not in the database.
|
||||
*/
|
||||
predicate returnsPointerThis(Function f) {
|
||||
f.getType().getUnspecifiedType() instanceof PointerType and
|
||||
forall(ReturnStmt s | s.getEnclosingFunction() = f and reachable(s) |
|
||||
// `return this`
|
||||
pointerThis(s.getExpr())
|
||||
@@ -64,7 +63,6 @@ predicate returnsPointerThis(Function f) {
|
||||
* database.
|
||||
*/
|
||||
predicate returnsDereferenceThis(Function f) {
|
||||
f.getType().getUnspecifiedType() instanceof ReferenceType and
|
||||
forall(ReturnStmt s | s.getEnclosingFunction() = f and reachable(s) |
|
||||
// `return *this`
|
||||
dereferenceThis(s.getExpr())
|
||||
|
||||
Reference in New Issue
Block a user