Address review comments

This commit is contained in:
Tom Hvitved
2020-12-01 14:51:57 +01:00
parent 9820dcb363
commit d50f5cc785
4 changed files with 11 additions and 64 deletions

View File

@@ -125,7 +125,12 @@ private module Cached {
predicate access(Generated::Identifier access, Variable variable) {
exists(string name | name = access.getValue() |
variable = enclosingScope(access).getVariable(name) and
not strictlyBefore(access.getLocation(), variable.getLocation())
not strictlyBefore(access.getLocation(), variable.getLocation()) and
// In case of overlapping parameter names, later parameters should not
// be considered accesses to the first parameter
if parameterAssignment(_, _, access)
then scopeDefinesParameterVariable(_, _, access)
else any()
or
exists(VariableScope declScope |
variable = declScope.getVariable(name) and