diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-07-08 07:02:42 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-07-08 07:02:53 -0400 |
| commit | c36e2bb9802ab4317980a98ea518483010fe2c80 (patch) | |
| tree | baa821f14f870a79ab9339f0994902502ef23f82 /src/InternPool.zig | |
| parent | 14192019ffcce6a3c60c8e761ca4ccedc2f027b0 (diff) | |
| download | zig-c36e2bb9802ab4317980a98ea518483010fe2c80.tar.gz zig-c36e2bb9802ab4317980a98ea518483010fe2c80.zip | |
InternPool: fix multi-thread build
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index c327172abf..1c501cb28e 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -878,7 +878,7 @@ pub const String = enum(u32) { fn wrap(unwrapped: Unwrapped, ip: *const InternPool) String { assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); assert(unwrapped.index <= ip.getIndexMask(u32)); - return @enumFromInt(@intFromEnum(unwrapped.tid) << ip.tid_shift_32 | unwrapped.index); + return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | unwrapped.index); } }; fn unwrap(string: String, ip: *const InternPool) Unwrapped { @@ -3408,7 +3408,7 @@ pub const Index = enum(u32) { fn wrap(unwrapped: Unwrapped, ip: *const InternPool) Index { assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask()); assert(unwrapped.index <= ip.getIndexMask(u31)); - return @enumFromInt(@intFromEnum(unwrapped.tid) << ip.tid_shift_31 | unwrapped.index); + return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_31 | unwrapped.index); } pub fn getExtra(unwrapped: Unwrapped, ip: *const InternPool) Local.Extra { @@ -9651,7 +9651,7 @@ pub fn getOrPutTrailingString( } const key: []const u8 = strings.view().items(.@"0")[start..]; const value: embedded_nulls.StringType() = - @enumFromInt(@intFromEnum(tid) << ip.tid_shift_32 | start); + @enumFromInt(@as(u32, @intFromEnum(tid)) << ip.tid_shift_32 | start); const has_embedded_null = std.mem.indexOfScalar(u8, key, 0) != null; switch (embedded_nulls) { .no_embedded_nulls => assert(!has_embedded_null), |
