mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Address review comments
This commit is contained in:
@@ -428,6 +428,9 @@ module RustDataFlow implements InputSig<Location> {
|
||||
private Function getStaticTargetExt(Call c) {
|
||||
result = c.getStaticTarget()
|
||||
or
|
||||
// If the static target of an overloaded operation cannot be resolved, we fall
|
||||
// back to the trait method as the target. This ensures that the flow models
|
||||
// still apply.
|
||||
not exists(c.getStaticTarget()) and
|
||||
exists(TraitItemNode t, string methodName |
|
||||
c.(Operation).isOverloaded(t, methodName, _) and
|
||||
|
||||
@@ -554,6 +554,8 @@ newtype TNode =
|
||||
e.hasEnclosingCfgScope() and
|
||||
(
|
||||
isArgumentForCall(e, _, _) and
|
||||
// For compound assignments into variables like `x += y`, we do not want flow into
|
||||
// `[post] x`, as that would create spurious flow when `x` is a parameter.
|
||||
not (e = any(CompoundAssignmentExpr cae).getLhs() and e instanceof VariableAccess)
|
||||
or
|
||||
lambdaCallExpr(_, _, e)
|
||||
|
||||
Reference in New Issue
Block a user