authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-29 21:55:27-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-29 21:55:27-05:00
logd87b13f2f7cef04058537c8bfeb1ceda1a067e73
treeb1c24137bf2f4c179f4f6c9007861c5ab8638e60
parent6936243ee1b933cba5d5e86c398ec39865e4db28
signaturelock-open Commit is signed but in an unrecognized format.

fix windows std lib regressions


5 files changed, 13 insertions(+), 13 deletions(-)

lib/std/coff.zig+3-3
......@@ -61,7 +61,7 @@ pub const Coff = struct {
6161
6262 var magic: [2]u8 = undefined;
6363 try in.readNoEof(magic[0..]);
64 if (!mem.eql(u8, magic, "MZ"))
64 if (!mem.eql(u8, &magic, "MZ"))
6565 return error.InvalidPEMagic;
6666
6767 // Seek to PE File Header (coff header)
......@@ -71,7 +71,7 @@ pub const Coff = struct {
7171
7272 var pe_header_magic: [4]u8 = undefined;
7373 try in.readNoEof(pe_header_magic[0..]);
74 if (!mem.eql(u8, pe_header_magic, [_]u8{ 'P', 'E', 0, 0 }))
74 if (!mem.eql(u8, &pe_header_magic, &[_]u8{ 'P', 'E', 0, 0 }))
7575 return error.InvalidPEHeader;
7676
7777 self.coff_header = CoffHeader{
......@@ -163,7 +163,7 @@ pub const Coff = struct {
163163 var cv_signature: [4]u8 = undefined; // CodeView signature
164164 try in.readNoEof(cv_signature[0..]);
165165 // 'RSDS' indicates PDB70 format, used by lld.
166 if (!mem.eql(u8, cv_signature, "RSDS"))
166 if (!mem.eql(u8, &cv_signature, "RSDS"))
167167 return error.InvalidPEMagic;
168168 try in.readNoEof(self.guid[0..]);
169169 self.age = try in.readIntLittle(u32);
lib/std/debug.zig+3-3
......@@ -825,7 +825,7 @@ fn openSelfDebugInfoWindows(allocator: *mem.Allocator) !DebugInfo {
825825 const len = try di.coff.getPdbPath(path_buf[0..]);
826826 const raw_path = path_buf[0..len];
827827
828 const path = try fs.path.resolve(allocator, [_][]const u8{raw_path});
828 const path = try fs.path.resolve(allocator, &[_][]const u8{raw_path});
829829
830830 try di.pdb.openFile(di.coff, path);
831831
......@@ -834,10 +834,10 @@ fn openSelfDebugInfoWindows(allocator: *mem.Allocator) !DebugInfo {
834834 const signature = try pdb_stream.stream.readIntLittle(u32);
835835 const age = try pdb_stream.stream.readIntLittle(u32);
836836 var guid: [16]u8 = undefined;
837 try pdb_stream.stream.readNoEof(guid[0..]);
837 try pdb_stream.stream.readNoEof(&guid);
838838 if (version != 20000404) // VC70, only value observed by LLVM team
839839 return error.UnknownPDBVersion;
840 if (!mem.eql(u8, di.coff.guid, guid) or di.coff.age != age)
840 if (!mem.eql(u8, &di.coff.guid, &guid) or di.coff.age != age)
841841 return error.PDBMismatch;
842842 // We validated the executable and pdb match.
843843
lib/std/os.zig+2-2
......@@ -1569,8 +1569,8 @@ pub fn isCygwinPty(handle: fd_t) bool {
15691569 const name_info = @ptrCast(*const windows.FILE_NAME_INFO, &name_info_bytes[0]);
15701570 const name_bytes = name_info_bytes[size .. size + @as(usize, name_info.FileNameLength)];
15711571 const name_wide = @bytesToSlice(u16, name_bytes);
1572 return mem.indexOf(u16, name_wide, [_]u16{ 'm', 's', 'y', 's', '-' }) != null or
1573 mem.indexOf(u16, name_wide, [_]u16{ '-', 'p', 't', 'y' }) != null;
1572 return mem.indexOf(u16, name_wide, &[_]u16{ 'm', 's', 'y', 's', '-' }) != null or
1573 mem.indexOf(u16, name_wide, &[_]u16{ '-', 'p', 't', 'y' }) != null;
15741574}
15751575
15761576pub const SocketError = error{
lib/std/os/windows.zig+3-3
......@@ -932,9 +932,9 @@ pub fn wToPrefixedFileW(s: []const u16) ![PATH_MAX_WIDE:0]u16 {
932932 // TODO https://github.com/ziglang/zig/issues/2765
933933 var result: [PATH_MAX_WIDE:0]u16 = undefined;
934934
935 const start_index = if (mem.startsWith(u16, s, [_]u16{ '\\', '?' })) 0 else blk: {
935 const start_index = if (mem.startsWith(u16, s, &[_]u16{ '\\', '?' })) 0 else blk: {
936936 const prefix = [_]u16{ '\\', '?', '?', '\\' };
937 mem.copy(u16, result[0..], prefix);
937 mem.copy(u16, result[0..], &prefix);
938938 break :blk prefix.len;
939939 };
940940 const end_index = start_index + s.len;
......@@ -961,7 +961,7 @@ pub fn sliceToPrefixedSuffixedFileW(s: []const u8, comptime suffix: []const u16)
961961 }
962962 const start_index = if (mem.startsWith(u8, s, "\\?") or !std.fs.path.isAbsolute(s)) 0 else blk: {
963963 const prefix = [_]u16{ '\\', '?', '?', '\\' };
964 mem.copy(u16, result[0..], prefix);
964 mem.copy(u16, result[0..], &prefix);
965965 break :blk prefix.len;
966966 };
967967 const end_index = start_index + try std.unicode.utf8ToUtf16Le(result[start_index..], s);
lib/std/pdb.zig+2-2
......@@ -500,7 +500,7 @@ const Msf = struct {
500500 const superblock = try in.readStruct(SuperBlock);
501501
502502 // Sanity checks
503 if (!mem.eql(u8, superblock.FileMagic, SuperBlock.file_magic))
503 if (!mem.eql(u8, &superblock.FileMagic, SuperBlock.file_magic))
504504 return error.InvalidDebugInfo;
505505 if (superblock.FreeBlockMapBlock != 1 and superblock.FreeBlockMapBlock != 2)
506506 return error.InvalidDebugInfo;
......@@ -546,7 +546,7 @@ const Msf = struct {
546546 const size = stream_sizes[i];
547547 if (size == 0) {
548548 stream.* = MsfStream{
549 .blocks = [_]u32{},
549 .blocks = &[_]u32{},
550550 };
551551 } else {
552552 var blocks = try allocator.alloc(u32, size);