aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-04-09 15:00:53 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-05-29 20:21:07 -0400
commit4188faeac56d9c022fa33449aa4283b1f55395cf (patch)
tree08c4597b591291362921fa705ce114175de65f05 /src/ir.cpp
parent4e1f3a9ba35530f129e43e11ac0676c562e4cb98 (diff)
downloadzig-4188faeac56d9c022fa33449aa4283b1f55395cf.tar.gz
zig-4188faeac56d9c022fa33449aa4283b1f55395cf.zip
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.
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp2
1 files changed, 1 insertions, 1 deletions
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;