mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Add types for more tuple extractions
Specifically, extractions where the RHS is a map element read or a channel receive will now have types.
This commit is contained in:
@@ -751,6 +751,18 @@ module IR {
|
||||
result = tae.getType().(TupleType).getComponentType(pragma[only_bind_into](i))
|
||||
)
|
||||
or
|
||||
exists(Instruction mapBase | this.getBase().readsElement(mapBase, _) |
|
||||
i = 0 and result = mapBase.getResultType().getUnderlyingType().(MapType).getValueType()
|
||||
or
|
||||
i = 1 and result = any(BoolExprType b)
|
||||
)
|
||||
or
|
||||
exists(RecvExpr re | this.getBase() = evalExprInstruction(re) |
|
||||
i = 0 and result = re.getOperand().getType().getUnderlyingType().(ChanType).getElementType()
|
||||
or
|
||||
i = 1 and result = any(BoolExprType b)
|
||||
)
|
||||
or
|
||||
exists(Type rangeType | rangeType = s.(RangeStmt).getDomain().getType().getUnderlyingType() |
|
||||
exists(Type baseType |
|
||||
baseType = rangeType.(ArrayType).getElementType() or
|
||||
|
||||
Reference in New Issue
Block a user