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 {...@@ -1011,7 +1011,7 @@ pub const Scope = struct {
1011 param_types: []const zir.Inst.Ref,1011 param_types: []const zir.Inst.Ref,
1012 ret_ty: zir.Inst.Ref,1012 ret_ty: zir.Inst.Ref,
1013 cc: zir.Inst.Ref,1013 cc: zir.Inst.Ref,
1014 }) !zir.Inst.Index {1014 }) !zir.Inst.Ref {
1015 assert(args.ret_ty != 0);1015 assert(args.ret_ty != 0);
1016 assert(args.cc != 0);1016 assert(args.cc != 0);
1017 const gpa = gz.zir_code.gpa;1017 const gpa = gz.zir_code.gpa;
...@@ -1075,7 +1075,7 @@ pub const Scope = struct {...@@ -1075,7 +1075,7 @@ pub const Scope = struct {
1075 args: []const zir.Inst.Ref,1075 args: []const zir.Inst.Ref,
1076 /// Absolute node index. This function does the conversion to offset from Decl.1076 /// Absolute node index. This function does the conversion to offset from Decl.
1077 abs_node_index: ast.Node.Index,1077 abs_node_index: ast.Node.Index,
1078 ) !zir.Inst.Index {1078 ) !zir.Inst.Ref {
1079 assert(callee != 0);1079 assert(callee != 0);
1080 assert(abs_node_index != 0);1080 assert(abs_node_index != 0);
1081 const gpa = gz.zir_code.gpa;1081 const gpa = gz.zir_code.gpa;