authorgravatar for sahnvour@pm.meSahnvour <sahnvour@pm.me> 2019-03-15 20:16:42+01:00
committergravatar for sahnvour@pm.meSahnvour <sahnvour@pm.me> 2019-03-16 15:34:14+01:00
log0d4a5c40bc97d65ede1923577b2ca9dac3a6c24f
tree3b235049bc69c6c0ecaee017307884ce64cf6215
parent6abe6dbfe445fb2a2b03dc53584215dfe22afd34

correct padding handling between std.pdb.ModInfo entries in DbiStream


1 files changed, 3 insertions(+), 2 deletions(-)

std/debug.zig+3-2
...@@ -881,8 +881,9 @@ fn openSelfDebugInfoWindows(allocator: *mem.Allocator) !DebugInfo {...@@ -881,8 +881,9 @@ fn openSelfDebugInfoWindows(allocator: *mem.Allocator) !DebugInfo {
881 const obj_file_name = try dbi.readNullTermString(allocator);881 const obj_file_name = try dbi.readNullTermString(allocator);
882 this_record_len += obj_file_name.len + 1;882 this_record_len += obj_file_name.len + 1;
883883
884 const march_forward_bytes = this_record_len % 4;884 if (this_record_len % 4 != 0) {
885 if (march_forward_bytes != 0) {885 const round_to_next_4 = (this_record_len | 0x3) + 1;
886 const march_forward_bytes = round_to_next_4 - this_record_len;
886 try dbi.seekForward(march_forward_bytes);887 try dbi.seekForward(march_forward_bytes);
887 this_record_len += march_forward_bytes;888 this_record_len += march_forward_bytes;
888 }889 }