Fix r21226 ... ugh.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Aug 2008 12:43:33 +0000 (12:43 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 20 Aug 2008 12:43:33 +0000 (12:43 +0000)
[r21278]

parser.c

index 9255860..ed42823 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -6646,8 +6646,15 @@ static type_t *semantic_arithmetic(type_t *type_left, type_t *type_right)
        if (get_atomic_type_size(s_rank) > get_atomic_type_size(u_rank))
                return s_type;
 
+       /* FIXME ugly */
        type_t *const type = allocate_type_zero(TYPE_ATOMIC, &builtin_source_position);
-       type->atomic.akind = find_unsigned_int_atomic_type_kind_for_size(s_rank);
+       switch (s_rank) {
+               case ATOMIC_TYPE_INT:      type->atomic.akind = ATOMIC_TYPE_UINT;      break;
+               case ATOMIC_TYPE_LONG:     type->atomic.akind = ATOMIC_TYPE_ULONG;     break;
+               case ATOMIC_TYPE_LONGLONG: type->atomic.akind = ATOMIC_TYPE_ULONGLONG; break;
+
+               default: panic("invalid atomic type");
+       }
 
        type_t* const result = typehash_insert(type);
        if (result != type)