From 4188faeac56d9c022fa33449aa4283b1f55395cf Mon Sep 17 00:00:00 2001 From: Shawn Landden Date: Tue, 9 Apr 2019 15:00:53 -0500 Subject: [PATCH] stage1: AstNodes cannot be casted, but are rather accessed via a union. Unlike IrInstruction[Foo]s, which all start with: IrInstruction base; AstNodes do not work like this, and instead use a pointer to their specializations. The code assumed otherwise. --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ir.cpp b/src/ir.cpp index fa60751ca5..ba6f256b40 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -18507,7 +18507,7 @@ static Error ir_make_type_info_defs(IrAnalyze *ira, IrInstruction *source_instr, return ErrorSemanticAnalyzeFail; } - AstNodeFnProto *fn_node = (AstNodeFnProto *)(fn_entry->proto_node); + AstNodeFnProto *fn_node = &fn_entry->proto_node->data.fn_proto; ConstExprValue *fn_def_val = create_const_vals(1); fn_def_val->special = ConstValSpecialStatic;