-
Notifications
You must be signed in to change notification settings - Fork 169
Fix "one before begin of" pointer formation #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but are the changes necessarily required in myersCalcEditDistanceNW()
? I don't immediately see where the pointer arithmetic can break down in that function.
Also I don't think that me approving this PR does anything really...
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