Kotlin: Fix varargs dataflow, and varargs default handling#10909
Merged
smowton merged 1 commit intogithub:mainfrom Oct 21, 2022
Merged
Kotlin: Fix varargs dataflow, and varargs default handling#10909smowton merged 1 commit intogithub:mainfrom
smowton merged 1 commit intogithub:mainfrom
Conversation
tamasvajk
reviewed
Oct 21, 2022
Contributor
tamasvajk
left a comment
There was a problem hiding this comment.
Found one minor issue, otherwise looks good to me.
| import org.jetbrains.kotlin.ir.IrElement | ||
| import org.jetbrains.kotlin.ir.IrStatement | ||
| import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI | ||
| import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.varargParameterIndex |
Contributor
There was a problem hiding this comment.
This import seems suspicious.
Dataflow requires accounting for the fact that the varargs parameter isn't necessarily last in the parameter list in a couple more places. Default handling just requires that if the only null parameter is the varargs argument, and it has no default value, then no $default method is required-- the caller is expected to simply pass nothing (at QL / source level) or an empty array (at JVM level).
7027654 to
1fe9e84
Compare
tamasvajk
approved these changes
Oct 21, 2022
smowton
added a commit
to smowton/codeql
that referenced
this pull request
Nov 1, 2022
…r just because there are no varargs This is the constructor case of github#10909
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dataflow requires accounting for the fact that the varargs parameter isn't necessarily last in the parameter list in a couple more places. Default handling just requires that if the only null parameter is the varargs argument, and it has no default value, then no $default method is required-- the caller is expected to simply pass nothing (at QL / source level) or an empty array (at JVM level).