authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-03-23 11:58:43+01:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-03-23 11:58:43+01:00
log668148549a822c7fa680cf08999dd845bde765aa
treed7d08e3c4d78e2f74b1ce7525a1990d52e2e7c8f
parentf3e8073e054c3bcf6fc8dd07cb164658da229b0a
signature Commit is signed but in an unrecognized format.

stage2: fix two return types to be Ref not Index

We currently have no type safety between zir.Inst.Ref, zir.Inst.Index, and plain u32s.

1 files changed, 2 insertions(+), 2 deletions(-)

src/Module.zig+2-2
......@@ -1011,7 +1011,7 @@ pub const Scope = struct {
10111011 param_types: []const zir.Inst.Ref,
10121012 ret_ty: zir.Inst.Ref,
10131013 cc: zir.Inst.Ref,
1014 }) !zir.Inst.Index {
1014 }) !zir.Inst.Ref {
10151015 assert(args.ret_ty != 0);
10161016 assert(args.cc != 0);
10171017 const gpa = gz.zir_code.gpa;
......@@ -1075,7 +1075,7 @@ pub const Scope = struct {
10751075 args: []const zir.Inst.Ref,
10761076 /// Absolute node index. This function does the conversion to offset from Decl.
10771077 abs_node_index: ast.Node.Index,
1078 ) !zir.Inst.Index {
1078 ) !zir.Inst.Ref {
10791079 assert(callee != 0);
10801080 assert(abs_node_index != 0);
10811081 const gpa = gz.zir_code.gpa;