Skip to content

Commit

Permalink
Add assertion to ensure components' size is correct in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Dec 4, 2024
1 parent a2e1e81 commit 35f5ffc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lrvm_tools/src/metadata/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ impl DeviceMetadata {
model: Option<u32>,
data: Option<u64>,
) -> Self {
assert_eq!(
size_bytes % 4,
0,
"Components' size must be a multiple of 4 bytes"
);

Self {
hw_id,
size_bytes,
Expand Down

0 comments on commit 35f5ffc

Please sign in to comment.