aboutsummaryrefslogtreecommitdiff
path: root/src/InternPool.zig
diff options
context:
space:
mode:
authorJacob Young <amazingjacob@gmail.com>2025-01-10 15:36:21 -0500
committerGitHub <noreply@github.com>2025-01-10 15:36:21 -0500
commit6cfc9c0e02cb1ccf9edfbdc64fcca285fea022fb (patch)
tree24805abd8c8d59ce75c8de4c057482a7e1dc5399 /src/InternPool.zig
parentb36ea592b86ef20473697ded24a27bb644941de8 (diff)
parent02692ad78cbdc1086abc4e37739e512c9203f486 (diff)
downloadzig-6cfc9c0e02cb1ccf9edfbdc64fcca285fea022fb.tar.gz
zig-6cfc9c0e02cb1ccf9edfbdc64fcca285fea022fb.zip
Merge pull request #22459 from jacobly0/fix-miscomps
cbe/x86_64: fix more miscomps
Diffstat (limited to 'src/InternPool.zig')
-rw-r--r--src/InternPool.zig17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig
index 7264f0b893..3b9fb29b86 100644
--- a/src/InternPool.zig
+++ b/src/InternPool.zig
@@ -5538,7 +5538,7 @@ pub const Tag = enum(u8) {
},
},
.type_union = .{
- .summary = .@"{.payload.name%summary#\"#\"}",
+ .summary = .@"{.payload.name%summary#\"}",
.payload = TypeUnion,
.trailing = struct {
captures_len: ?u32,
@@ -6584,7 +6584,7 @@ pub fn init(ip: *InternPool, gpa: Allocator, available_threads: usize) !void {
}
pub fn deinit(ip: *InternPool, gpa: Allocator) void {
- if (!builtin.strip_debug_info) std.debug.assert(debug_state.intern_pool == null);
+ if (debug_state.enable_checks) std.debug.assert(debug_state.intern_pool == null);
ip.file_deps.deinit(gpa);
ip.src_hash_deps.deinit(gpa);
@@ -6629,7 +6629,7 @@ pub fn deinit(ip: *InternPool, gpa: Allocator) void {
}
pub fn activate(ip: *const InternPool) void {
- if (builtin.strip_debug_info) return;
+ if (!debug_state.enable) return;
_ = Index.Unwrapped.debug_state;
_ = String.debug_state;
_ = OptionalString.debug_state;
@@ -6639,18 +6639,23 @@ pub fn activate(ip: *const InternPool) void {
_ = TrackedInst.Index.Optional.debug_state;
_ = Nav.Index.debug_state;
_ = Nav.Index.Optional.debug_state;
- std.debug.assert(debug_state.intern_pool == null);
+ if (debug_state.enable_checks) std.debug.assert(debug_state.intern_pool == null);
debug_state.intern_pool = ip;
}
pub fn deactivate(ip: *const InternPool) void {
- if (builtin.strip_debug_info) return;
+ if (!debug_state.enable) return;
std.debug.assert(debug_state.intern_pool == ip);
- debug_state.intern_pool = null;
+ if (debug_state.enable_checks) debug_state.intern_pool = null;
}
/// For debugger access only.
const debug_state = struct {
+ const enable = switch (builtin.zig_backend) {
+ else => false,
+ .stage2_x86_64 => !builtin.strip_debug_info,
+ };
+ const enable_checks = enable and !builtin.single_threaded;
threadlocal var intern_pool: ?*const InternPool = null;
};