mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: dbscheme/library changes to support C99 designated initializers
This commit is contained in:
@@ -173,7 +173,7 @@ class ClassAggregateLiteral extends AggregateLiteral {
|
||||
*/
|
||||
Expr getFieldExpr(Field field) {
|
||||
field = classType.getAField() and
|
||||
result = getChild(field.getInitializationOrder())
|
||||
aggregate_field_init(this, result, field)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,7 +230,7 @@ class ArrayAggregateLiteral extends AggregateLiteral {
|
||||
* element `elementIndex`, if present.
|
||||
*/
|
||||
Expr getElementExpr(int elementIndex) {
|
||||
result = getChild(elementIndex)
|
||||
aggregate_array_init(this, result, elementIndex)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1400,6 +1400,18 @@ new_array_allocated_type(
|
||||
int type_id: @type ref
|
||||
);
|
||||
|
||||
aggregate_field_init(
|
||||
unique int aggregate: @aggregateliteral ref,
|
||||
int initializer: @expr ref,
|
||||
int field: @membervariable ref
|
||||
);
|
||||
|
||||
aggregate_array_init(
|
||||
unique int aggregate: @aggregateliteral ref,
|
||||
int initializer: @expr ref,
|
||||
int element_index: int ref
|
||||
);
|
||||
|
||||
@ctorinit = @ctordirectinit
|
||||
| @ctorvirtualinit
|
||||
| @ctorfieldinit
|
||||
|
||||
Reference in New Issue
Block a user