X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Fentity.c;h=d67cc45320ec63af91e304742f5227201743f0d7;hb=0379b8ff173a6da82f869ec8ac195a38c488eaa6;hp=ca7fff3e15a67c2bacad1ff7b4224e8c100f4387;hpb=0fa3829724b2f75bdfce909508ba29f9c2b78ca2;p=libfirm diff --git a/ir/tr/entity.c b/ir/tr/entity.c index ca7fff3e1..d67cc4532 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -364,13 +364,15 @@ set_array_entity_values(entity *ent, tarval **values, int num_vals) { assert(is_array_type(arrtp)); assert(get_array_n_dimensions(arrtp) == 1); - assert(get_array_lower_bound (arrtp, 0) && get_array_upper_bound (arrtp, 0)); + /* One bound is sufficient, the nunmber of constant fields makes the + size. */ + assert(get_array_lower_bound (arrtp, 0) || get_array_upper_bound (arrtp, 0)); assert(get_entity_variability(ent) != uninitialized); current_ir_graph = get_const_code_irg(); for (i = 0; i < num_vals; i++) { val = new_Const(get_tv_mode (values[i]), values[i]); - set_compound_ent_value(ent, val, get_array_element_entity(arrtp), i); + add_compound_ent_value(ent, val, get_array_element_entity(arrtp)); } current_ir_graph = rem; }