|
|
|
|
|
by dev_dwarf
997 days ago
|
|
Interesting point. I modified my example to test what you described. I had to play with the compilation flags to get the allocs to not be optimized out and to not panic when the integer overflow happens, but otherwise I didn't change the logic. I'm pretty sure my implementation is correctly handling the case you mention, evidenced by it returning a null pointer. Link: https://godbolt.org/z/f1jGW6Pa3 Update:
NVM, definitely not being handled correctly. https://godbolt.org/z/cMTe1o979 |
|