File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ This changelog tracks the Rust `svdtools` project. See
7
7
8
8
* Revert #145
9
9
* Improve "Could not find errors"
10
+ * use register size as dimIncrement for 1-element arrays
10
11
11
12
## [ v0.3.3] 2023-10-02
12
13
Original file line number Diff line number Diff line change @@ -1202,7 +1202,15 @@ fn collect_in_array(
1202
1202
. iter ( )
1203
1203
. map ( |r| r. address_offset )
1204
1204
. collect :: < Vec < _ > > ( ) ;
1205
- let dim_increment = if dim > 1 { offsets[ 1 ] - offsets[ 0 ] } else { 0 } ;
1205
+ let dim_increment = if dim > 1 {
1206
+ offsets[ 1 ] - offsets[ 0 ]
1207
+ } else {
1208
+ registers[ 0 ]
1209
+ . properties
1210
+ . size
1211
+ . map ( |s| s / 8 )
1212
+ . unwrap_or_default ( )
1213
+ } ;
1206
1214
if !check_offsets ( & offsets, dim_increment) {
1207
1215
return Err ( anyhow ! (
1208
1216
"{}: registers cannot be collected into {rspec} array. Different addressOffset increments" ,
You can’t perform that action at this time.
0 commit comments