File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
10
10
- Add ` riscv ` element for configuration parameters related to RISC-V targets.
11
11
You must use the ` unstable-riscv ` feature to enable this exeperimental element.
12
12
- Add ` DataType `
13
+ - Fix run-time panic for write constraint check
13
14
14
15
## [ v0.14.8] - 2024-02-13
15
16
Original file line number Diff line number Diff line change @@ -336,8 +336,13 @@ impl FieldInfo {
336
336
}
337
337
}
338
338
339
- if let Some ( WriteConstraint :: Range ( constraint) ) = self . write_constraint {
340
- constraint. check_range ( 0 ..2_u64 . pow ( self . bit_range . width ) ) ?;
339
+ match self . write_constraint {
340
+ // If the bit_range has its maximum width, all values will of
341
+ // course fit in so we can skip validation.
342
+ Some ( WriteConstraint :: Range ( constraint) ) if self . bit_range . width < 64 => {
343
+ constraint. check_range ( 0 ..2_u64 . pow ( self . bit_range . width ) ) ?;
344
+ }
345
+ _ => ( ) ,
341
346
}
342
347
}
343
348
You can’t perform that action at this time.
0 commit comments