mirror of
https://github.com/github/codeql.git
synced 2026-04-25 00:35:20 +02:00
Rust: Ensure that TPositionalArgumentPosition is large enough for struct expressions
This commit is contained in:
@@ -9,7 +9,12 @@ module Impl {
|
||||
// For the type `FunctionPosition` used by type inference, we work with function-call syntax
|
||||
// adjusted positions, so a call like `x.m(a, b, c)` needs positions `0` through `3`; for this
|
||||
// reason, there is no `- 1` after `max(...)` below.
|
||||
i in [0 .. max([any(ParamList l).getNumberOfParams(), any(ArgList l).getNumberOfArgs()])]
|
||||
i in [0 .. max([
|
||||
any(ParamList l).getNumberOfParams(),
|
||||
any(ArgList l).getNumberOfArgs(),
|
||||
any(StructFieldList l).getNumberOfFields() // Positions are used for struct expressions in type inference
|
||||
]
|
||||
)]
|
||||
} or
|
||||
TSelfArgumentPosition() or
|
||||
TTypeQualifierArgumentPosition()
|
||||
|
||||
Reference in New Issue
Block a user