authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-07-08 07:02:42-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-07-08 07:02:53-04:00
logc36e2bb9802ab4317980a98ea518483010fe2c80
treebaa821f14f870a79ab9339f0994902502ef23f82
parent14192019ffcce6a3c60c8e761ca4ccedc2f027b0

InternPool: fix multi-thread build


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

src/InternPool.zig+3-3
......@@ -878,7 +878,7 @@ pub const String = enum(u32) {
878878 fn wrap(unwrapped: Unwrapped, ip: *const InternPool) String {
879879 assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask());
880880 assert(unwrapped.index <= ip.getIndexMask(u32));
881 return @enumFromInt(@intFromEnum(unwrapped.tid) << ip.tid_shift_32 | unwrapped.index);
881 return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_32 | unwrapped.index);
882882 }
883883 };
884884 fn unwrap(string: String, ip: *const InternPool) Unwrapped {
......@@ -3408,7 +3408,7 @@ pub const Index = enum(u32) {
34083408 fn wrap(unwrapped: Unwrapped, ip: *const InternPool) Index {
34093409 assert(@intFromEnum(unwrapped.tid) <= ip.getTidMask());
34103410 assert(unwrapped.index <= ip.getIndexMask(u31));
3411 return @enumFromInt(@intFromEnum(unwrapped.tid) << ip.tid_shift_31 | unwrapped.index);
3411 return @enumFromInt(@as(u32, @intFromEnum(unwrapped.tid)) << ip.tid_shift_31 | unwrapped.index);
34123412 }
34133413
34143414 pub fn getExtra(unwrapped: Unwrapped, ip: *const InternPool) Local.Extra {
......@@ -9651,7 +9651,7 @@ pub fn getOrPutTrailingString(
96519651 }
96529652 const key: []const u8 = strings.view().items(.@"0")[start..];
96539653 const value: embedded_nulls.StringType() =
9654 @enumFromInt(@intFromEnum(tid) << ip.tid_shift_32 | start);
9654 @enumFromInt(@as(u32, @intFromEnum(tid)) << ip.tid_shift_32 | start);
96559655 const has_embedded_null = std.mem.indexOfScalar(u8, key, 0) != null;
96569656 switch (embedded_nulls) {
96579657 .no_embedded_nulls => assert(!has_embedded_null),