| author | |
| committer | |
| log | b4b92c71e551f6fdbc08879efe3650816bed1e14 |
| tree | 5e60d6e197254f76acd143972bd6da814f6829ff |
| parent | a69438f95cca0af4f3cc81237777e565c6b07efc |
2 files changed, 6 insertions(+), 2 deletions(-)
lib/std/Build/Cache.zig+2| ... | @@ -1007,6 +1007,8 @@ pub const Manifest = struct { | ... | @@ -1007,6 +1007,8 @@ pub const Manifest = struct { |
| 1007 | keep = try addPrefixedPathPost(self, prefixed_path); | 1007 | keep = try addPrefixedPathPost(self, prefixed_path); |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| 1010 | /// Low level function. `prefixed_path` references cloned memory. Returns | ||
| 1011 | /// whether or not `prefixed_path.sub_path` should be kept. | ||
| 1010 | pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool { | 1012 | pub fn addPrefixedPathPost(man: *Manifest, prefixed_path: PrefixedPath) !bool { |
| 1011 | assert(man.manifest_file != null); | 1013 | assert(man.manifest_file != null); |
| 1012 | const gpa = man.cache.gpa; | 1014 | const gpa = man.cache.gpa; |
lib/std/zig.zig+4-2| ... | @@ -1754,8 +1754,10 @@ pub fn buildExeSubprocess(gpa: Allocator, io: Io, options: BuildExeSubprocessOpt | ... | @@ -1754,8 +1754,10 @@ pub fn buildExeSubprocess(gpa: Allocator, io: Io, options: BuildExeSubprocessOpt |
| 1754 | var it = mem.splitScalar(u8, body, 0); | 1754 | var it = mem.splitScalar(u8, body, 0); |
| 1755 | while (it.next()) |prefixed_path| { | 1755 | while (it.next()) |prefixed_path| { |
| 1756 | const prefix: Server.Message.PathPrefix = @enumFromInt(prefixed_path[0] - 1); | 1756 | const prefix: Server.Message.PathPrefix = @enumFromInt(prefixed_path[0] - 1); |
| 1757 | const sub_path = prefixed_path[1..]; | 1757 | const sub_path = try gpa.dupe(u8, prefixed_path[1..]); |
| 1758 | _ = man.addPrefixedPathPost(.{ | 1758 | var keep = false; |
| 1759 | defer if (!keep) gpa.free(sub_path); | ||
| 1760 | keep = man.addPrefixedPathPost(.{ | ||
| 1759 | .prefix = @intFromEnum(prefix), | 1761 | .prefix = @intFromEnum(prefix), |
| 1760 | .sub_path = sub_path, | 1762 | .sub_path = sub_path, |
| 1761 | }) catch |err| switch (err) { | 1763 | }) catch |err| switch (err) { |