File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -688,7 +688,7 @@ pub fn gen_register(r: &Register,
688
688
field. name
689
689
. to_snake_case( ) ) ) ;
690
690
let width = field. bit_range . width ;
691
- let mask = Lit :: Int ( ( 1u64 << width - 1 ) , IntTy :: Unsuffixed ) ;
691
+ let mask = Lit :: Int ( ( 1u64 << width) - 1 , IntTy :: Unsuffixed ) ;
692
692
let offset = Lit :: Int ( u64:: from ( field. bit_range . offset ) ,
693
693
IntTy :: Unsuffixed ) ;
694
694
let field_ty = width. to_ty ( ) ;
@@ -908,7 +908,7 @@ pub fn gen_register(r: &Register,
908
908
let field_name_sc = Ident :: new ( & * field. name
909
909
. to_sanitized_snake_case ( ) ) ;
910
910
let width = field. bit_range . width ;
911
- let mask = Lit :: Int ( ( 1u64 << width - 1 ) , IntTy :: Unsuffixed ) ;
911
+ let mask = Lit :: Int ( ( 1u64 << width) - 1 , IntTy :: Unsuffixed ) ;
912
912
let offset = Lit :: Int ( u64:: from ( field. bit_range . offset ) ,
913
913
IntTy :: Unsuffixed ) ;
914
914
let field_ty = width. to_ty ( ) ;
You can’t perform that action at this time.
0 commit comments