diff options
author | Cameron McCormack <cam@mcc.id.au> | 2019-10-07 14:04:46 +1100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-10-08 14:38:35 +0200 |
commit | 22b1094189b6f6d95f347483639bb9d2da9d7f02 (patch) | |
tree | 03284836974ced5d880c3ebb3def66a09abed999 /src/codegen/mod.rs | |
parent | 807fa1e959781721f202fb0d8e2f3f8fc955f1e9 (diff) |
Fix BitfieldUnit constructor to handle 64 bit wide bitfields on 32 bit.
Fixes #1639.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index bce52c53..32dc48a1 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1200,12 +1200,8 @@ impl BitfieldUnit { impl Bitfield { /// Extend an under construction bitfield unit constructor with this - /// bitfield. This involves two things: - /// - /// 1. Adding a parameter with this bitfield's name and its type. - /// - /// 2. Setting the relevant bits on the `__bindgen_bitfield_unit` variable - /// that's being constructed. + /// bitfield. This sets the relevant bits on the `__bindgen_bitfield_unit` + /// variable that's being constructed. fn extend_ctor_impl( &self, ctx: &BindgenContext, @@ -1216,7 +1212,9 @@ impl Bitfield { let bitfield_ty_layout = bitfield_ty .layout(ctx) .expect("Bitfield without layout? Gah!"); - let bitfield_int_ty = helpers::blob(ctx, bitfield_ty_layout); + let bitfield_int_ty = helpers::integer_type(ctx, bitfield_ty_layout) + .expect("Should already have verified that the bitfield is \ + representable as an int"); let offset = self.offset_into_unit(); let width = self.width() as u8; |