force_align was applied after struct size was set.

Change-Id: I9a35afac41f27dfdbc5e793c41ec768732cdc2a1
Tested: on Windows.
parent 58703a4f
......@@ -638,8 +638,6 @@ void Parser::ParseDecl() {
struct_def.attributes.Lookup("original_order") == nullptr && !fixed;
Expect('{');
while (token_ != '}') ParseField(struct_def);
struct_def.PadLastField(struct_def.minalign);
Expect('}');
auto force_align = struct_def.attributes.Lookup("force_align");
if (fixed && force_align) {
auto align = static_cast<size_t>(atoi(force_align->constant.c_str()));
......@@ -651,6 +649,8 @@ void Parser::ParseDecl() {
"struct\'s natural alignment to 256");
struct_def.minalign = align;
}
struct_def.PadLastField(struct_def.minalign);
Expect('}');
}
bool Parser::SetRootType(const char *name) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment