Commit 3cf855d3 authored by Michael Beck's avatar Michael Beck
Browse files

BugFix: allow method entities to be initialized by an const_initializer.

[r27255]
parent e6fe1244
......@@ -725,13 +725,17 @@ static void check_entity_initializer(ir_entity *entity)
{
#ifndef NDEBUG
ir_initializer_t *initializer = entity->initializer;
ir_type *entity_tp = get_entity_type(entity);
switch (initializer->kind) {
case IR_INITIALIZER_COMPOUND:
assert(is_compound_entity(entity));
assert(is_compound_type(entity_tp));
break;
case IR_INITIALIZER_CONST:
/* methods are initialized by a SymConst */
assert(is_atomic_type(entity_tp) || is_Method_type(entity_tp));
break;
case IR_INITIALIZER_TARVAL:
assert(is_atomic_entity(entity));
assert(is_atomic_type(entity_tp));
break;
case IR_INITIALIZER_NULL:
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment