Skip to content

Commit df9132e

Browse files
Merge branch 'rust-embedded:master' into master
2 parents e18035d + b01c136 commit df9132e

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

svd-parser/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Add `riscv` element for configuration parameters related to RISC-V targets.
1212
You must use the `unstable-riscv` feature to enable this exeperimental element.
1313
- Bump MSRV to 1.65.0
14+
- Bump roxmltree to 0.20
1415

1516
## [v0.14.5] - 2024-01-03
1617

svd-parser/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ unstable-riscv = ["svd-rs/unstable-riscv"]
2121

2222
[dependencies]
2323
svd-rs = { version = "0.14.7", path = "../svd-rs" }
24-
roxmltree = "0.19"
24+
roxmltree = "0.20"
2525
anyhow = "1.0.58"
2626
thiserror = "1.0.31"
2727

svd-rs/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Add `riscv` element for configuration parameters related to RISC-V targets.
1212
You must use the `unstable-riscv` feature to enable this exeperimental element.
1313
- Add `DataType`
14+
- Fix run-time panic for write constraint check
1415

1516
## [v0.14.8] - 2024-02-13
1617

svd-rs/src/field.rs

+7-2
Original file line numberDiff line numberDiff 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

tests/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ unstable-riscv = ["svd-rs/unstable-riscv", "svd-parser/unstable-riscv", "svd-enc
1414
svd-rs = { path = "../svd-rs"}
1515
svd-parser = { path = "../svd-parser"}
1616
svd-encoder = { path = "../svd-encoder"}
17-
roxmltree = "0.19"
17+
roxmltree = "0.20"
1818
xmltree = "0.10.3"
1919
anyhow = "1.0.45"

0 commit comments

Comments
 (0)