diff options
| author | der-teufel-programming <46651553+der-teufel-programming@users.noreply.github.com> | 2022-08-18 14:10:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-18 14:10:47 +0200 |
| commit | 3ed9cdc1cc848119d857c8e88b17cc3698eaedac (patch) | |
| tree | fb191657475cbee057f017f7c55e411a0740c8b2 /lib/std | |
| parent | 656b9429d05c4aad2d514e6d4df15326d903e3f4 (diff) | |
| parent | df507edffe6c1087b5f4786cb64ccaffd02b6848 (diff) | |
| download | zig-3ed9cdc1cc848119d857c8e88b17cc3698eaedac.tar.gz zig-3ed9cdc1cc848119d857c8e88b17cc3698eaedac.zip | |
Merge branch 'ziglang:master' into master
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os.zig | 1 | ||||
| -rw-r--r-- | lib/std/pdb.zig | 9 | ||||
| -rw-r--r-- | lib/std/zig/system/NativePaths.zig | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index 984758565c..c757561b07 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2651,6 +2651,7 @@ pub fn renameatW( .creation = windows.FILE_OPEN, .io_mode = .blocking, .filter = .any, // This function is supposed to rename both files and directories. + .follow_symlinks = false, }) catch |err| switch (err) { error.WouldBlock => unreachable, // Not possible without `.share_access_nonblocking = true`. else => |e| return e, diff --git a/lib/std/pdb.zig b/lib/std/pdb.zig index a44296c920..00ce2cc5ba 100644 --- a/lib/std/pdb.zig +++ b/lib/std/pdb.zig @@ -310,6 +310,10 @@ pub const SymbolKind = enum(u16) { pub const TypeIndex = u32; +// TODO According to this header: +// https://github.com/microsoft/microsoft-pdb/blob/082c5290e5aff028ae84e43affa8be717aa7af73/include/cvinfo.h#L3722 +// we should define RecordPrefix as part of the ProcSym structure. +// This might be important when we start generating PDB in self-hosted with our own PE linker. pub const ProcSym = extern struct { Parent: u32, End: u32, @@ -321,8 +325,7 @@ pub const ProcSym = extern struct { CodeOffset: u32, Segment: u16, Flags: ProcSymFlags, - // following is a null terminated string - // Name: [*]u8, + Name: [1]u8, // null-terminated }; pub const ProcSymFlags = packed struct { @@ -693,7 +696,7 @@ pub const Pdb = struct { .S_LPROC32, .S_GPROC32 => { const proc_sym = @ptrCast(*align(1) ProcSym, &module.symbols[symbol_i + @sizeOf(RecordPrefix)]); if (address >= proc_sym.CodeOffset and address < proc_sym.CodeOffset + proc_sym.CodeSize) { - return mem.sliceTo(@ptrCast([*:0]u8, proc_sym) + @sizeOf(ProcSym), 0); + return mem.sliceTo(@ptrCast([*:0]u8, &proc_sym.Name[0]), 0); } }, else => {}, diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig index e9e7460314..5f52b04ce4 100644 --- a/lib/std/zig/system/NativePaths.zig +++ b/lib/std/zig/system/NativePaths.zig @@ -109,6 +109,8 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths if (native_target.os.tag != .windows) { const triple = try native_target.linuxTriple(allocator); + defer allocator.free(triple); + const qual = native_target.cpu.arch.ptrBitWidth(); // TODO: $ ld --verbose | grep SEARCH_DIR |
