another test
[libfirm] / ir / be / begnuas.c
index 2fff607..7ca9fcf 100644 (file)
@@ -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) {