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 {
7
7
ParseError ,
8
8
MsbLsb ,
9
9
Empty ,
10
+ Size ,
10
11
}
11
12
12
13
impl Parse for BitRange {
@@ -83,6 +84,9 @@ impl Parse for BitRange {
83
84
return Err ( SVDError :: InvalidBitRange ( InvalidBitRange :: Syntax ) . at ( tree. id ( ) ) ) ;
84
85
} ;
85
86
87
+ if start > end {
88
+ return Err ( SVDError :: InvalidBitRange ( InvalidBitRange :: Size ) . at ( tree. id ( ) ) ) ;
89
+ }
86
90
Ok ( Self {
87
91
offset : start,
88
92
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/).
7
7
8
8
## Unreleased
9
9
10
+ - Add check for wrong size of ` bitRange ` width
10
11
- Don't clone when serialize
11
12
- Add optional entries to ` Cpu `
12
13
- ` AddressBlock ` & ` Interrupt ` now use builders
You can’t perform that action at this time.
0 commit comments