Commit 2d8adf41 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Check that we have a normal entity before fetching its initilizer.

Strange casts may cause that a Load ends up with a method entity to load from.
parent cec38646
......@@ -7328,7 +7328,8 @@ ir_node *predict_load(ir_node *ptr, ir_mode *mode)
}
if (is_Address(ptr)) {
ir_entity *entity = get_Address_entity(ptr);
if (! (get_entity_linkage(entity) & IR_LINKAGE_CONSTANT))
if (get_entity_kind(entity) != IR_ENTITY_NORMAL ||
!(get_entity_linkage(entity) & IR_LINKAGE_CONSTANT))
return NULL;
const ir_type *type = get_entity_type(entity);
if (get_type_state(type) != layout_fixed)
......
Supports Markdown
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