File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ pub enum InvalidBitRange {
77 ParseError ,
88 MsbLsb ,
99 Empty ,
10+ Size ,
1011}
1112
1213impl Parse for BitRange {
@@ -83,6 +84,9 @@ impl Parse for BitRange {
8384 return Err ( SVDError :: InvalidBitRange ( InvalidBitRange :: Syntax ) . at ( tree. id ( ) ) ) ;
8485 } ;
8586
87+ if start > end {
88+ return Err ( SVDError :: InvalidBitRange ( InvalidBitRange :: Size ) . at ( tree. id ( ) ) ) ;
89+ }
8690 Ok ( Self {
8791 offset : start,
8892 width : end - start + 1 ,
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
88## Unreleased
99
10+ - Add check for wrong size of ` bitRange ` width
1011- Don't clone when serialize
1112- Add optional entries to ` Cpu `
1213- ` AddressBlock ` & ` Interrupt ` now use builders
You can’t perform that action at this time.
0 commit comments