Pointer alignment fixes for the stdlib
This commit is contained in:
parent
e134e6c994
commit
7fe13f4a86
@ -1084,7 +1084,7 @@ fn openSelfDebugInfoMacOs(allocator: *mem.Allocator) !DebugInfo {
|
|||||||
std.macho.LC_SYMTAB => break @ptrCast(*std.macho.symtab_command, ptr),
|
std.macho.LC_SYMTAB => break @ptrCast(*std.macho.symtab_command, ptr),
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
ptr += lc.cmdsize; // TODO https://github.com/ziglang/zig/issues/1403
|
ptr = @alignCast(@alignOf(std.macho.load_command), ptr + lc.cmdsize);
|
||||||
} else {
|
} else {
|
||||||
return error.MissingDebugInfo;
|
return error.MissingDebugInfo;
|
||||||
};
|
};
|
||||||
@ -2129,7 +2129,7 @@ fn getLineNumberInfoMacOs(di: *DebugInfo, symbol: MachoSymbol, target_address: u
|
|||||||
std.macho.LC_SEGMENT_64 => break @ptrCast(*const std.macho.segment_command_64, @alignCast(@alignOf(std.macho.segment_command_64), ptr)),
|
std.macho.LC_SEGMENT_64 => break @ptrCast(*const std.macho.segment_command_64, @alignCast(@alignOf(std.macho.segment_command_64), ptr)),
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
ptr += lc.cmdsize; // TODO https://github.com/ziglang/zig/issues/1403
|
ptr = @alignCast(@alignOf(std.macho.load_command), ptr + lc.cmdsize);
|
||||||
} else {
|
} else {
|
||||||
return error.MissingDebugInfo;
|
return error.MissingDebugInfo;
|
||||||
};
|
};
|
||||||
|
@ -1263,7 +1263,7 @@ pub fn Watch(comptime V: type) type {
|
|||||||
var ptr = event_buf[0..].ptr;
|
var ptr = event_buf[0..].ptr;
|
||||||
const end_ptr = ptr + event_buf.len;
|
const end_ptr = ptr + event_buf.len;
|
||||||
var ev: *os.linux.inotify_event = undefined;
|
var ev: *os.linux.inotify_event = undefined;
|
||||||
while (@ptrToInt(ptr) < @ptrToInt(end_ptr)) : (ptr += @sizeOf(os.linux.inotify_event) + ev.len) {
|
while (@ptrToInt(ptr) < @ptrToInt(end_ptr)) {
|
||||||
ev = @ptrCast(*os.linux.inotify_event, ptr);
|
ev = @ptrCast(*os.linux.inotify_event, ptr);
|
||||||
if (ev.mask & os.linux.IN_CLOSE_WRITE == os.linux.IN_CLOSE_WRITE) {
|
if (ev.mask & os.linux.IN_CLOSE_WRITE == os.linux.IN_CLOSE_WRITE) {
|
||||||
const basename_ptr = ptr + @sizeOf(os.linux.inotify_event);
|
const basename_ptr = ptr + @sizeOf(os.linux.inotify_event);
|
||||||
@ -1287,6 +1287,8 @@ pub fn Watch(comptime V: type) type {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ptr = @alignCast(@alignOf(os.linux.inotify_event), ptr + @sizeOf(os.linux.inotify_event) + ev.len);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
os.linux.EINTR => continue,
|
os.linux.EINTR => continue,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user