1
Fork 0

librustc: Bump the offset when translating const structs. Closes #6352.

This commit is contained in:
Patrick Walton 2013-05-30 17:08:49 -07:00
parent 3a3bf8bdef
commit 40b455792d
2 changed files with 15 additions and 0 deletions

View file

@ -563,6 +563,7 @@ fn build_const_struct(ccx: @CrateContext, st: &Struct, vals: &[ValueRef])
vals[i]
};
cfields.push(val);
offset += machine::llsize_of_alloc(ccx, llty) as u64
}
return cfields;

View file

@ -0,0 +1,14 @@
enum Foo {
IntVal(i32),
Int64Val(i64)
}
struct Bar {
i: i32,
v: Foo
}
static bar: Bar = Bar { i: 0, v: IntVal(0) };
fn main() {}