Skip to content

Commit

Permalink
how the hell did these casts break
Browse files Browse the repository at this point in the history
  • Loading branch information
mlugg committed Aug 7, 2024
1 parent 9c34f6d commit e96b967
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/link.zig
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ pub const File = struct {
const emit = base.emit;
if (base.child_pid) |pid| {
if (builtin.os.tag == .windows) {
base.cast(Coff).?.ptraceAttach(pid) catch |err| {
base.cast(.coff).?.ptraceAttach(pid) catch |err| {
log.warn("attaching failed with error: {s}", .{@errorName(err)});
};
} else {
Expand All @@ -249,7 +249,7 @@ pub const File = struct {
.linux => std.posix.ptrace(std.os.linux.PTRACE.ATTACH, pid, 0, 0) catch |err| {
log.warn("ptrace failure: {s}", .{@errorName(err)});
},
.macos => base.cast(MachO).?.ptraceAttach(pid) catch |err| {
.macos => base.cast(.macho).?.ptraceAttach(pid) catch |err| {
log.warn("attaching failed with error: {s}", .{@errorName(err)});
},
.windows => unreachable,
Expand Down Expand Up @@ -317,10 +317,10 @@ pub const File = struct {

if (base.child_pid) |pid| {
switch (builtin.os.tag) {
.macos => base.cast(MachO).?.ptraceDetach(pid) catch |err| {
.macos => base.cast(.macho).?.ptraceDetach(pid) catch |err| {
log.warn("detaching failed with error: {s}", .{@errorName(err)});
},
.windows => base.cast(Coff).?.ptraceDetach(pid),
.windows => base.cast(.coff).?.ptraceDetach(pid),
else => return error.HotSwapUnavailableOnHostOperatingSystem,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/link/MachO/ZigObject.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ fn isThreadlocal(macho_file: *MachO, nav_index: InternPool.Nav.Index) bool {
return switch (ip.indexToKey(ip.getNav(nav_index).status.resolved.val)) {
.variable => |variable| variable.is_threadlocal,
.@"extern" => |@"extern"| @"extern".is_threadlocal,
else => unreachable,
else => false,
};
}

Expand Down

0 comments on commit e96b967

Please sign in to comment.