authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-05-02 00:00:32-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
log72716ecc3a1f236fc46d754fa7387317c40aade5
treef87c8a8303f2da03d3fe4bb2c191a569eb834cf6
parentc3c332c9ecf8ab982ca1b704a54b7d1b439b520d

Fix improper initialization of CacheHashFiles


1 files changed, 4 insertions(+), 0 deletions(-)

lib/std/cache_hash.zig+4
...@@ -103,6 +103,7 @@ pub const CacheHash = struct {...@@ -103,6 +103,7 @@ pub const CacheHash = struct {
103 var cache_hash_file = try self.files.addOne();103 var cache_hash_file = try self.files.addOne();
104 cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path});104 cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path});
105 cache_hash_file.max_file_size = max_file_size;105 cache_hash_file.max_file_size = max_file_size;
106 cache_hash_file.contents = null;
106107
107 self.addSlice(cache_hash_file.path.?);108 self.addSlice(cache_hash_file.path.?);
108109
...@@ -175,6 +176,7 @@ pub const CacheHash = struct {...@@ -175,6 +176,7 @@ pub const CacheHash = struct {
175 cache_hash_file = try self.files.addOne();176 cache_hash_file = try self.files.addOne();
176 cache_hash_file.path = null;177 cache_hash_file.path = null;
177 cache_hash_file.max_file_size = null;178 cache_hash_file.max_file_size = null;
179 cache_hash_file.contents = null;
178 }180 }
179181
180 var iter = mem.tokenize(line, " ");182 var iter = mem.tokenize(line, " ");
...@@ -301,6 +303,8 @@ pub const CacheHash = struct {...@@ -301,6 +303,8 @@ pub const CacheHash = struct {
301303
302 var cache_hash_file = try self.files.addOne();304 var cache_hash_file = try self.files.addOne();
303 cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path});305 cache_hash_file.path = try fs.path.resolve(self.alloc, &[_][]const u8{file_path});
306 cache_hash_file.max_file_size = max_file_size_opt;
307 cache_hash_file.contents = null;
304308
305 const contents = try self.populate_file_hash_fetch(otherAlloc, cache_hash_file);309 const contents = try self.populate_file_hash_fetch(otherAlloc, cache_hash_file);
306310