X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbegnuas.c;h=7ca9fcfa86a86f5a7b91b4d52b285f5c92e3a4bb;hb=afbbc0b1ccd684c4c24bfd43d0f994123245f39f;hp=2fff6070a6fadaca9ee8ae5138e930790c96c96c;hpb=f6c661bb22cf365d8fb10b3b97817acec61532bb;p=libfirm diff --git a/ir/be/begnuas.c b/ir/be/begnuas.c index 2fff6070a..7ca9fcfa8 100644 --- a/ir/be/begnuas.c +++ b/ir/be/begnuas.c @@ -816,6 +816,7 @@ static void dump_bitfield(normal_or_bitfield *vals, size_t offset_bits, if (tv == NULL) { panic("Couldn't get numeric value for bitfield initializer"); } + tv = tarval_convert_to(tv, get_type_mode(type)); /* normalize offset */ vals += offset_bits >> 3; @@ -953,7 +954,7 @@ static void dump_initializer(be_gas_decl_env_t *env, ir_entity *entity) * In the worst case, every initializer allocates one byte. * Moreover, initializer might be big, do not allocate on stack. */ - vals = xcalloc(size, sizeof(vals[0])); + vals = XMALLOCNZ(normal_or_bitfield, size); #ifndef NDEBUG glob_vals = vals; @@ -1042,7 +1043,7 @@ static void dump_compound_init(be_gas_decl_env_t *env, ir_entity *ent) * In the worst case, every initializer allocates one byte. * Moreover, initializer might be big, do not allocate on stack. */ - vals = xcalloc(last_ofs, sizeof(vals[0])); + vals = XMALLOCNZ(normal_or_bitfield, last_ofs); /* collect the values and store them at the offsets */ for (i = 0; i < n; ++i) {