Guard against overflow for dynamic interval overlap - #60
Conversation
Fixes #61 |
5cript
commented
Jun 25, 2026
Thank you for the contribution |
Uh oh!
There was an error while loading. Please reload this page.
I did some commits on top: Can i turn this review upside down? :D I can put them on top of your contribution or follow them up afterwards. Or you cherry pick them yourself |
whimxiqal
commented
Jun 25, 2026
Ah good point with the negative numbers. Cherry-picked! |
| ```bash | ||
| mkdir build | ||
| cd build | ||
| cmake --build . |
There was a problem hiding this comment.
cmake .. -DINT_TREE_ENABLE_TESTS=on
Configure step is missing.
| find_package(GTest REQUIRED) | ||
| include(FetchContent) | ||
| FetchContent_Declare( |
There was a problem hiding this comment.
Yes this is easier and I only accept this because its for tests only where it doesnt matter.
FetchContent cannot be used in network isolated contexts such as flatpak and yocto.
Just letting you know.
5cript
commented
Jun 25, 2026
Thanks a lot for improving this library! |
The dynamic interval
overlapsmethod contains addition code to the boundaries regardless of whether those values would overflow. This can cause wrong results at, at the very least, compiler errors depending on the compiler options.These changes guard against such addition/subtraction and add tests with additional compiler options to error on integer overflow.
I've also adjusted the workflow, CMake, and README files to streamline testing a bit.