Skip to content

Commit

Permalink
stage1: AstNodes cannot be casted, but are rather accessed via a union.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shawnl authored and andrewrk committed May 30, 2019
1 parent 4e1f3a9 commit 4188fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4188fae

Please sign in to comment.