Visitar URL original
JS: Fix parsing of Member[num] token in summaries by asgerf · Pull Request #22784 · github/codeql · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ ArgumentPosition decodeUnknownArgumentPosition(AccessPathSyntax::AccessPathToken
* `encodeContent` predicate.
*/
bindingset[token]
ContentSet decodeUnknownContent(AccessPathSyntax::AccessPathTokenBase token) { none() }
ContentSet decodeUnknownContent(AccessPathSyntax::AccessPathTokenBase token) {
token.getName() = "Member" and
result.asPropertyName() = token.getAnArgument()
}

/**
* Gets a return kind corresponding to the unknown token `token`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ postIsInSameCallable
reverseRead
| tst.js:109:11:113:3 | [dynamic parameter array] | Origin of readStep is missing a PostUpdateNode. |
| tst.js:267:28:267:31 | map3 | Origin of readStep is missing a PostUpdateNode. |
| tst.js:305:30:305:43 | constructedMap | Origin of readStep is missing a PostUpdateNode. |
argHasPostUpdate
postWithInFlow
viableImplInCallContextTooLarge
Expand Down
8 changes: 8 additions & 0 deletions javascript/ql/test/library-tests/FlowSummary/tst.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,11 @@ function m18() {
sink(dynamicParam1("safe", ...[source()])); // NOT OK
sink(dynamicParam1(source(), ...["safe"])); // OK
}

function m19() {
const constructedMap = new Map([["key", source()]]);
for (const [key, value] of constructedMap) {
sink(key); // OK
sink(value); // NOT OK
}
}
Loading