translate-c: get real child type of array type for incomplete initializers and/or multi-dimensional arrays.
parent
5bf9ffdc5b
commit
dd5450e7b9
|
@ -4079,7 +4079,7 @@ static AstNode *trans_ap_value(Context *c, APValue *ap_value, QualType qt, const
|
||||||
init_node->data.container_init_expr.type = arr_type_node;
|
init_node->data.container_init_expr.type = arr_type_node;
|
||||||
init_node->data.container_init_expr.kind = ContainerInitKindArray;
|
init_node->data.container_init_expr.kind = ContainerInitKindArray;
|
||||||
|
|
||||||
QualType child_qt = qt.getTypePtr()->getLocallyUnqualifiedSingleStepDesugaredType();
|
QualType child_qt = qt.getTypePtr()->getAsArrayTypeUnsafe()->getElementType();
|
||||||
|
|
||||||
for (size_t i = 0; i < init_count; i += 1) {
|
for (size_t i = 0; i < init_count; i += 1) {
|
||||||
APValue &elem_ap_val = ap_value->getArrayInitializedElt(i);
|
APValue &elem_ap_val = ap_value->getArrayInitializedElt(i);
|
||||||
|
|
Loading…
Reference in New Issue