diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-09-29 12:06:35 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-09-29 12:06:35 -0700 |
| commit | d8fa8b5455058d235793a8b9ecdf252fb8dd8782 (patch) | |
| tree | 554f28740f2fae3c36e7ae507f850d55a026d455 /src/link/Coff.zig | |
| parent | 3efdd7b2ad6cce5985d761240636b3d5eb3b4c84 (diff) | |
| download | zig-d8fa8b5455058d235793a8b9ecdf252fb8dd8782.tar.gz zig-d8fa8b5455058d235793a8b9ecdf252fb8dd8782.zip | |
use Allocator.allocSentinel now that the stage1 bug is fixed
Thanks @LemonBoy!
Diffstat (limited to 'src/link/Coff.zig')
| -rw-r--r-- | src/link/Coff.zig | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/link/Coff.zig b/src/link/Coff.zig index 0356a327ba..424ece511b 100644 --- a/src/link/Coff.zig +++ b/src/link/Coff.zig @@ -1118,9 +1118,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void { Compilation.dump_argv(argv.items); } - const new_argv_with_sentinel = try arena.alloc(?[*:0]const u8, argv.items.len + 1); - new_argv_with_sentinel[argv.items.len] = null; - const new_argv = new_argv_with_sentinel[0..argv.items.len :null]; + const new_argv = try arena.allocSentinel(?[*:0]const u8, argv.items.len, null); for (argv.items) |arg, i| { new_argv[i] = try arena.dupeZ(u8, arg); } |
