From 9bef5ec01abfffc01067d3ed1817f13b4918b315 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 1 Jul 2018 16:21:32 +0100 Subject: Fix anonymous procedures --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 5b97a79d2..9103b5491 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1578,7 +1578,7 @@ void ir_emit_zero_init(irProcedure *p, irValue *address, Ast *expr) { args[0] = ir_emit_conv(p, address, t_rawptr); args[1] = ir_const_int(a, type_size_of(t)); AstPackage *pkg = get_core_package(p->module->info, str_lit("mem")); - if (p->entity->token.string != "zero" && p->entity->pkg != pkg) { + if (p->entity != nullptr && p->entity->token.string != "zero" && p->entity->pkg != pkg) { ir_emit_package_call(p, "mem", "zero", args, expr); } ir_emit(p, ir_instr_zero_init(p, address)); -- cgit v1.2.3