| ... | ... | @@ -1909,14 +1909,15 @@ fn emitTagNameFunction( |
| 1909 | 1909 | const zcu = comp.zcu.?; |
| 1910 | 1910 | const ip = &zcu.intern_pool; |
| 1911 | 1911 | const enum_type = ip.loadEnumType(enum_type_ip); |
| 1912 | const tag_values = enum_type.values.get(ip); |
| 1912 | 1913 | |
| 1913 | 1914 | try code.ensureUnusedCapacity(gpa, 7 * 5 + 6 + 1 * 6); |
| 1914 | 1915 | appendReservedUleb32(code, 0); // no locals |
| 1915 | 1916 | |
| 1916 | 1917 | const slice_abi_size = 8; |
| 1917 | 1918 | const encoded_alignment = @ctz(@as(u32, 4)); |
| 1918 | | if (enum_type.tag_mode == .auto) { |
| 1919 | | // Then it's a direct table lookup. |
| 1919 | if (tag_values.len == 0) { |
| 1920 | // Then it's auto-numbered and therefore a direct table lookup. |
| 1920 | 1921 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.local_get)); |
| 1921 | 1922 | appendReservedUleb32(code, 0); |
| 1922 | 1923 | |
| ... | ... | @@ -1948,7 +1949,7 @@ fn emitTagNameFunction( |
| 1948 | 1949 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.block)); |
| 1949 | 1950 | code.appendAssumeCapacity(@intFromEnum(outer_block_type)); |
| 1950 | 1951 | |
| 1951 | | for (enum_type.values.get(ip), 0..) |tag_value, tag_index| { |
| 1952 | for (tag_values, 0..) |tag_value, tag_index| { |
| 1952 | 1953 | // block for this if case |
| 1953 | 1954 | code.appendAssumeCapacity(@intFromEnum(std.wasm.Opcode.block)); |
| 1954 | 1955 | code.appendAssumeCapacity(@intFromEnum(std.wasm.BlockType.empty)); |