The recent MR !2994 (merged) exposed a bug (see here) in RawBank::end<T>() and RawBank::range<T>() where sizeof(T) is more than 1. The default for RawBank::range<>() happens to be unsigned int which means that the last 1-3 bytes are potentially lost.
Perhaps T should be hardcoded to char, as generalizing to other types in this place makes little sense.
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Related merge requests
3
When these merge requests are accepted, this issue will be closed automatically.
well, if you ask for a T with sizeof(T) larger than one, truncating is the only thing that can be done in case size() is not a multiple of sizeof(T), as otherwise it would be an out-of-bounds access to uninitialised memory. So in those cases that happens, one could say it is a mistake by the caller (i.e. the question should not have been asked)... hence my remark that the solution is presumably to make it (more) explicit to the caller to make sure they ask the right question...
because most subdetector payloads are 32-bit (or 16-bit) unsigned integer (or a mix of them), and this would move the problem from one central place to many decoders... basically, most places select a 'subspan' of a bank for a given type, and then loop over the values, so there should be a uniform way to do that without everyone re-inventing the wheel...