From ddbd460331196e8b043e55b6c21389d60c947a8f Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 1 May 2012 12:14:07 +0200 Subject: [PATCH] Check for TYPE_FIELD in load_from_ent --- ir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ir.c b/ir.c index 2d5977a..720efc9 100644 --- a/ir.c +++ b/ir.c @@ -964,6 +964,10 @@ ir_value* ir_block_create_load_from_ent(ir_block *self, const char *label, ir_va if (ent->vtype != TYPE_ENTITY) return NULL; + /* at some point we could redirect for TYPE_POINTER... but that could lead to carelessness */ + if (field->vtype != TYPE_FIELD) + return NULL; + switch (outype) { case TYPE_FLOAT: op = INSTR_LOAD_F; break; -- 2.39.2