Skip to content

Commit 8264afa

Browse files
author
bors-servo
authored
Auto merge of #494 - flier:fix-493, r=emilio
check empty layout when padding bytes fast workaround to fix issue #493 need to investigate why layout is empty
2 parents 86ce9dd + df2ff4f commit 8264afa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/codegen/struct_layout.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ impl<'a, 'ctx> StructLayoutTracker<'a, 'ctx> {
163163
}
164164

165165
fn padding_bytes(&self, layout: Layout) -> usize {
166-
if self.latest_offset % layout.align == 0 {
166+
if layout.align == 0 {
167+
warn!("try to padding bytes without layout");
168+
169+
0
170+
} else if self.latest_offset % layout.align == 0 {
167171
0
168172
} else {
169173
layout.align - (self.latest_offset % layout.align)

0 commit comments

Comments
 (0)