aboutsummaryrefslogtreecommitdiff
path: root/std/debug.zig
diff options
context:
space:
mode:
authorSahnvour <sahnvour@pm.me>2019-03-15 20:16:42 +0100
committerSahnvour <sahnvour@pm.me>2019-03-16 15:34:14 +0100
commit0d4a5c40bc97d65ede1923577b2ca9dac3a6c24f (patch)
tree3b235049bc69c6c0ecaee017307884ce64cf6215 /std/debug.zig
parent6abe6dbfe445fb2a2b03dc53584215dfe22afd34 (diff)
downloadzig-0d4a5c40bc97d65ede1923577b2ca9dac3a6c24f.tar.gz
zig-0d4a5c40bc97d65ede1923577b2ca9dac3a6c24f.zip
correct padding handling between std.pdb.ModInfo entries in DbiStream
Diffstat (limited to 'std/debug.zig')
-rw-r--r--std/debug.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/std/debug.zig b/std/debug.zig
index b666e816af..0b5fc97f87 100644
--- a/std/debug.zig
+++ b/std/debug.zig
@@ -881,8 +881,9 @@ fn openSelfDebugInfoWindows(allocator: *mem.Allocator) !DebugInfo {
const obj_file_name = try dbi.readNullTermString(allocator);
this_record_len += obj_file_name.len + 1;
- const march_forward_bytes = this_record_len % 4;
- if (march_forward_bytes != 0) {
+ if (this_record_len % 4 != 0) {
+ const round_to_next_4 = (this_record_len | 0x3) + 1;
+ const march_forward_bytes = round_to_next_4 - this_record_len;
try dbi.seekForward(march_forward_bytes);
this_record_len += march_forward_bytes;
}