| ... | @@ -2594,12 +2594,12 @@ fn walkInstruction( | ... | @@ -2594,12 +2594,12 @@ fn walkInstruction( |
| 2594 | | 2594 | |
| 2595 | // We delay analysis because union tags can refer to | 2595 | // We delay analysis because union tags can refer to |
| 2596 | // decls defined inside the union itself. | 2596 | // decls defined inside the union itself. |
| 2597 | const tag_type_ref: Ref = if (small.has_tag_type) blk: { | 2597 | const tag_type_ref: ?Ref = if (small.has_tag_type) blk: { |
| 2598 | const tag_type = file.zir.extra[extra_index]; | 2598 | const tag_type = file.zir.extra[extra_index]; |
| 2599 | extra_index += 1; | 2599 | extra_index += 1; |
| 2600 | const tag_ref = @intToEnum(Ref, tag_type); | 2600 | const tag_ref = @intToEnum(Ref, tag_type); |
| 2601 | break :blk tag_ref; | 2601 | break :blk tag_ref; |
| 2602 | } else .none; | 2602 | } else null; |
| 2603 | | 2603 | |
| 2604 | const body_len = if (small.has_body_len) blk: { | 2604 | const body_len = if (small.has_body_len) blk: { |
| 2605 | const body_len = file.zir.extra[extra_index]; | 2605 | const body_len = file.zir.extra[extra_index]; |
| ... | @@ -2626,13 +2626,13 @@ fn walkInstruction( | ... | @@ -2626,13 +2626,13 @@ fn walkInstruction( |
| 2626 | ); | 2626 | ); |
| 2627 | | 2627 | |
| 2628 | // Analyze the tag once all decls have been analyzed | 2628 | // Analyze the tag once all decls have been analyzed |
| 2629 | const tag_type = try self.walkRef( | 2629 | const tag_type = if (tag_type_ref) |tt_ref| (try self.walkRef( |
| 2630 | file, | 2630 | file, |
| 2631 | &scope, | 2631 | &scope, |
| 2632 | parent_src, | 2632 | parent_src, |
| 2633 | tag_type_ref, | 2633 | tt_ref, |
| 2634 | false, | 2634 | false, |
| 2635 | ); | 2635 | )).expr else null; |
| 2636 | | 2636 | |
| 2637 | // Fields | 2637 | // Fields |
| 2638 | extra_index += body_len; | 2638 | extra_index += body_len; |
| ... | @@ -2664,7 +2664,7 @@ fn walkInstruction( | ... | @@ -2664,7 +2664,7 @@ fn walkInstruction( |
| 2664 | .privDecls = priv_decl_indexes.items, | 2664 | .privDecls = priv_decl_indexes.items, |
| 2665 | .pubDecls = decl_indexes.items, | 2665 | .pubDecls = decl_indexes.items, |
| 2666 | .fields = field_type_refs.items, | 2666 | .fields = field_type_refs.items, |
| 2667 | .tag = tag_type.expr, | 2667 | .tag = tag_type, |
| 2668 | .auto_enum = small.auto_enum_tag, | 2668 | .auto_enum = small.auto_enum_tag, |
| 2669 | .parent_container = parent_scope.enclosing_type, | 2669 | .parent_container = parent_scope.enclosing_type, |
| 2670 | }, | 2670 | }, |
| ... | @@ -2855,6 +2855,9 @@ fn walkInstruction( | ... | @@ -2855,6 +2855,9 @@ fn walkInstruction( |
| 2855 | break :blk fields_len; | 2855 | break :blk fields_len; |
| 2856 | } else 0; | 2856 | } else 0; |
| 2857 | | 2857 | |
| | 2858 | // We don't care about decls yet |
| | 2859 | if (small.has_decls_len) extra_index += 1; |
| | 2860 | |
| 2858 | var backing_int: ?DocData.Expr = null; | 2861 | var backing_int: ?DocData.Expr = null; |
| 2859 | if (small.has_backing_int) { | 2862 | if (small.has_backing_int) { |
| 2860 | const backing_int_body_len = file.zir.extra[extra_index]; | 2863 | const backing_int_body_len = file.zir.extra[extra_index]; |