Fix bounds checking assertion failure caused by overzealous glibc.

This commit is contained in:
David Given
2022-06-16 19:30:43 +02:00
parent a9e82676c7
commit 3e97faa704

View File

@@ -32,14 +32,14 @@ public:
{ return !(*this == other); }
const uint8_t& operator [] (unsigned offset) const;
const uint8_t* cbegin() const { return &(*_data)[_low]; }
const uint8_t* cend() const { return &(*_data)[_high]; }
const uint8_t* begin() const { return &(*_data)[_low]; }
const uint8_t* end() const { return &(*_data)[_high]; }
const uint8_t* cbegin() const { return _data->data() + _low; }
const uint8_t* cend() const { return _data->data() + _high; }
const uint8_t* begin() const { return _data->data() + _low; }
const uint8_t* end() const { return _data->data() + _high; }
uint8_t& operator [] (unsigned offset);
uint8_t* begin() { checkWritable(); return &(*_data)[_low]; }
uint8_t* end() { checkWritable(); return &(*_data)[_high]; }
uint8_t* begin() { checkWritable(); return _data->data() + _low; }
uint8_t* end() { checkWritable(); return _data->data() + _high; }
operator std::string () const { return std::string(cbegin(), cend()); }