Rust: Exclude deref expressions on raw pointers from call resolution stats

This commit is contained in:
Tom Hvitved
2025-12-09 08:54:51 +01:00
parent bfa37b8488
commit 31b184a404

View File

@@ -8,6 +8,7 @@ import rust
import codeql.util.ReportStats
import codeql.rust.elements.internal.CallExprImpl::Impl as CallExprImpl
import codeql.rust.internal.TypeInference as TypeInference
import codeql.rust.internal.Type
/**
* A file that is included in the quality statistics.
@@ -30,7 +31,8 @@ module CallTargetStats implements StatsSig {
RelevantInvocationExpr() {
this.getFile() instanceof RelevantFile and
not this instanceof CallExprImpl::DynamicCallExpr and
not this = any(Operation o | not o.isOverloaded(_, _, _))
not this = any(Operation o | not o.isOverloaded(_, _, _)) and
not this = any(DerefExpr de | TypeInference::inferType(de.getExpr()) instanceof PtrType)
}
}