The code in questions comes from Shewchuk's triangle code, which hasn't been updated to fix the out-of-buffer access problem that ASAN finds in the delaunay unit test. The problem is benign: the code would exit the loop before using the value fetched from beyond the end of the buffer, but to make ASAN happy, I put in a couple extra tests to not fetch values that aren't going to be used.