3 ms·
Not only this, but also out of bounds accesses using UBSan: https://godbolt.org/z/q9qsax7qY https://godbolt.org/z/q9qsax7qY (also compiler support is still im
by uecker 4y ago
Not only this, but also out of bounds accesses using UBSan:
https://godbolt.org/z/q9qsax7qY https://godbolt.org/z/q9qsax7qY
(also compiler support is still improving)
- Jorengarenar 4y agoI'm not sure about this example. It basically shows that if you use automatic VLA you have can do some checks on VLA. But if I prohibit automatic VLA altogether and use fixed size array, I don't need to worry about that at all and the example falls back to what I presented with UBSan doing just its regular thing.
- uecker 4y agoIf you have larger fixed size array you can get an error when you overflow the larger array. But this then does not necessarily prevent invalid accesses to the parts of the array which go beyond the actual size of what is stored in it or might not prevent bound overflows when copying from the array to some other place.