mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpiutil] Fix MemoryBuffer initialization (#4797)
Dereferencing an end iterator is undefined behavior and causes a failed assertion when running in Windows debug.
This commit is contained in:
@@ -105,7 +105,7 @@ template <typename MB>
|
||||
class MemoryBufferMem : public MB {
|
||||
public:
|
||||
explicit MemoryBufferMem(std::span<const uint8_t> inputData) {
|
||||
MemoryBuffer::Init(&*inputData.begin(), &*inputData.end());
|
||||
MemoryBuffer::Init(inputData.data(), inputData.data() + inputData.size());
|
||||
}
|
||||
|
||||
/// Disable sized deallocation for MemoryBufferMem, because it has
|
||||
|
||||
Reference in New Issue
Block a user