rename getASourceAccess to getAnAliasedSourceNode

This commit is contained in:
Erik Krogh Kristensen
2020-01-31 15:34:58 +01:00
parent e6d46b9279
commit 72114a48f5
3 changed files with 3 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ abstract class EnumeratedPropName extends DataFlow::Node {
* For example, gets `src[key]` in `for (var key in src) { src[key]; }`.
*/
PropRead getASourceProp() {
result = AccessPath::getASourceAccess(getSourceObject()).getAPropertyRead() and
result = AccessPath::getAnAliasedSourceNode(getSourceObject()).getAPropertyRead() and
result.getPropertyNameExpr().flow().getImmediatePredecessor*() = this
}
}

View File

@@ -416,7 +416,7 @@ module AccessPath {
/**
* Gets a SourceNode that is accessed using the same access path as the input.
*/
DataFlow::SourceNode getASourceAccess(DataFlow::Node node) {
DataFlow::SourceNode getAnAliasedSourceNode(DataFlow::Node node) {
exists(DataFlow::SourceNode root, string accessPath |
node = AccessPath::getAReferenceTo(root, accessPath) and
result = AccessPath::getAReferenceTo(root, accessPath)

View File

@@ -168,7 +168,7 @@ module StringOps {
(call.getMethodName() = "substring" or call.getMethodName() = "substr" or call.getMethodName() = "slice") and
call.getNumArgument() = 2 and
(
AccessPath::getASourceAccess(substring).getAPropertyRead("length").flowsTo(call.getArgument(1))
AccessPath::getAnAliasedSourceNode(substring).getAPropertyRead("length").flowsTo(call.getArgument(1))
or
substring.getStringValue().length() = call.getArgument(1).asExpr().getIntValue()
)