Skip to content

Commit 187148c

Browse files
committed
transpile: always cast bitfield accesses to expected type
1 parent c0809f5 commit 187148c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

c2rust-transpile/src/translator/operators.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,7 @@ impl<'c> Translation<'c> {
310310
};
311311

312312
if let Some(field_id) = bitfield_id {
313-
let rhs_expr = if compute_lhs_type_id.ctype == initial_lhs_type_id.ctype {
314-
rhs_translation.to_expr()
315-
} else {
316-
mk().cast_expr(rhs_translation.to_expr(), ty)
317-
};
318-
313+
let rhs_expr = mk().cast_expr(rhs_translation.to_expr(), ty);
319314
return self.convert_bitfield_assignment_op_with_rhs(ctx, op, lhs, rhs_expr, *field_id);
320315
}
321316

0 commit comments

Comments
 (0)