File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 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/).
1010- Add ` riscv ` element for configuration parameters related to RISC-V targets.
1111 You must use the ` unstable-riscv ` feature to enable this exeperimental element.
1212- Add ` DataType `
13+ - Fix run-time panic for write constraint check
1314
1415## [ v0.14.8] - 2024-02-13
1516
Original file line number Diff line number Diff line change @@ -336,8 +336,13 @@ impl FieldInfo {
336336 }
337337 }
338338
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+ _ => ( ) ,
341346 }
342347 }
343348
You can’t perform that action at this time.
0 commit comments