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,
688688 field. name
689689 . to_snake_case( ) ) ) ;
690690 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 ) ;
692692 let offset = Lit :: Int ( u64:: from ( field. bit_range . offset ) ,
693693 IntTy :: Unsuffixed ) ;
694694 let field_ty = width. to_ty ( ) ;
@@ -908,7 +908,7 @@ pub fn gen_register(r: &Register,
908908 let field_name_sc = Ident :: new ( & * field. name
909909 . to_sanitized_snake_case ( ) ) ;
910910 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 ) ;
912912 let offset = Lit :: Int ( u64:: from ( field. bit_range . offset ) ,
913913 IntTy :: Unsuffixed ) ;
914914 let field_ty = width. to_ty ( ) ;
You can’t perform that action at this time.
0 commit comments