translate-c: get real child type of array type for incomplete initializers and/or multi-dimensional arrays.

master
Sahnvour 2019-01-26 13:51:50 +01:00
parent 5bf9ffdc5b
commit dd5450e7b9
1 changed files with 1 additions and 1 deletions

View File

@ -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);