Commit 0fa89dc51d

LeRoyce Pearson <leroycepearson@geemili.xyz>
2020-05-01 01:04:13
Fix read from null pointer in CacheHash.hit
It occured when the manifest file was manually edited to include an extra file. Now it will simply copy the file name in the manifest file
1 parent f13c67b
Changed files (1)
lib/std/cache_hash.zig
@@ -186,6 +186,10 @@ pub const CacheHash = struct {
                 return error.InvalidFormat;
             }
 
+            if (cache_hash_file.path == null) {
+                cache_hash_file.path = try mem.dupe(self.alloc, u8, file_path);
+            }
+
             const this_file = fs.cwd().openFile(cache_hash_file.path.?, .{ .read = true }) catch {
                 return error.CacheUnavailable;
             };