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.
This commit is contained in:
Shawn Landden 2019-04-09 15:00:53 -05:00 committed by Andrew Kelley
parent 4e1f3a9ba3
commit 4188faeac5

View File

@ -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;