-
-
Notifications
You must be signed in to change notification settings - Fork 282
Incorrect LLVM type for struct with single align(1) member #4719
Copy link
Copy link
Closed
Description
This test case triggers the assert:
Line 43 in 48c1dff
| assert((m_offset & (fieldAlignment - 1)) == 0 && "Field is misaligned"); |
pragma(msg, TraceBuf.alignof); // prints 1
struct TraceBuf {
align(1) uint args;
}
void foo() {
byte[2] fixDescs;
TraceBuf fixLog;
auto dlg = delegate() {
fixDescs[0] = 1;
fixLog.args = 1;
};
}This is a minimized testcase, that no longer crashes LDC. The original case ran into the error
Error: variable ... overlaps previous field. This is an ICE, please file an LDC issue.
The reason is that the LLVM type is wrong since 1.31.0.
Used to be:
%example.TraceBuf = type <{ i32 }>
but now is:
%example.TraceBuf = type { i32 }, i.e. alignment is not 1 but 4.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels