aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorJonathan S <gereeter+code@gmail.com>2020-03-27 14:28:48 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-05-29 18:23:06 -0400
commit631633b25253201968b97cf129d986def37eed4a (patch)
treea09677ad9b9e71568c4ad384ac48a2a71710f628 /lib/std/debug.zig
parent4c8b937fb016a54b09d7447ca634b7cf1af78fce (diff)
downloadzig-631633b25253201968b97cf129d986def37eed4a.tar.gz
zig-631633b25253201968b97cf129d986def37eed4a.zip
Document and reduce usage of MAX_PATH_BYTES, lifting arbitrary buffer size requirements
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 3e52770932..aea9bcef51 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -1283,6 +1283,9 @@ pub const DebugInfo = struct {
const elf_path = if (ctx.name.len > 0)
ctx.name
else blk: {
+ // Use of MAX_PATH_BYTES here is valid as the resulting path is immediately
+ // opened with no modification. TODO: Use openSelfExe instead to avoid path
+ // length limitations
var buf: [fs.MAX_PATH_BYTES]u8 = undefined;
break :blk try fs.selfExePath(&buf);
};