From 72716ecc3a1f236fc46d754fa7387317c40aade5 Mon Sep 17 00:00:00 2001 From: LeRoyce Pearson Date: Sat, 2 May 2020 00:00:32 -0600 Subject: [PATCH] Fix improper initialization of CacheHashFiles --- lib/std/cache_hash.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/std/cache_hash.zig b/lib/std/cache_hash.zig index 17de195422..a383666713 100644 --- a/lib/std/cache_hash.zig +++ b/lib/std/cache_hash.zig @@ -103,6 +103,7 @@ pub const CacheHash = struct { var cache_hash_file = try self.files.addOne(); cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path}); cache_hash_file.max_file_size = max_file_size; + cache_hash_file.contents = null; self.addSlice(cache_hash_file.path.?); @@ -175,6 +176,7 @@ pub const CacheHash = struct { cache_hash_file = try self.files.addOne(); cache_hash_file.path = null; cache_hash_file.max_file_size = null; + cache_hash_file.contents = null; } var iter = mem.tokenize(line, " "); @@ -301,6 +303,8 @@ pub const CacheHash = struct { var cache_hash_file = try self.files.addOne(); cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path}); + cache_hash_file.max_file_size = max_file_size_opt; + cache_hash_file.contents = null; const contents = try self.populate_file_hash_fetch(otherAlloc, cache_hash_file);