Fix "one before begin of" pointer formation#237
Fix "one before begin of" pointer formation#237Martinsos merged 1 commit intoMartinsos:masterfrom SoapZA:fix-233
Conversation
* Forming a pointer "one before" the start of a range is UB: https://devblogs.microsoft.com/oldnewthing/20211112-00/?p=105908 * GCC 13's UBSAN detects this now: https://gcc.gnu.org/cgit/gcc/commit?id=28896b38fabce8 * By using a (signed) index, we can avoid forming invalid pointers. Fixes #233
|
I just did it for consistency, but yes, that function didn't fail. Using indices is a bit debug friendlier on |
|
@SoapZA thanks for this -> I will have to take some time to properly study this stuff, but I will do it! Hopefully in the next weeks. |
|
Logically, I'm pretty sure these don't have an impact, since changing a Performance-wise, I haven't checked, but since the compiler can see the |
|
Thanks @SoapZA , merged! |
|
@SoapZA would you be interested in being added to Edlib as collaborator? You have contributed quite a bit in the last years and seem to know C/C++ quite well + you are active in the field of bioinformatics, would be great to have you involved. I have been the only maintainer from the very start and it would be good to add more people. No obligations or anything, it would just make it easier for you to contribute if you wish, and be able to do things even if I am occupied or something. |
|
@Martinsos that would be great! |
Fixes #233