Remove wrong test from is_string_type(): Pointers are not string types.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 13 Jun 2012 14:05:46 +0000 (16:05 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 14 Jun 2012 08:38:11 +0000 (10:38 +0200)
ast2firm.c

index c85a8a1..9b88760 100644 (file)
@@ -3782,15 +3782,10 @@ static ir_initializer_t *create_ir_initializer_value(
 /** test wether type can be initialized by a string constant */
 static bool is_string_type(type_t *type)
 {
-       type_t *inner;
-       if (is_type_pointer(type)) {
-               inner = skip_typeref(type->pointer.points_to);
-       } else if(is_type_array(type)) {
-               inner = skip_typeref(type->array.element_type);
-       } else {
+       if (!is_type_array(type))
                return false;
-       }
 
+       type_t *const inner = skip_typeref(type->array.element_type);
        return is_type_integer(inner);
 }