3 ms·
In case anyone else wonders how the code in the linked tweet [0] would format your hard drive, it's the missing return on f1. Therefore, f1 is empty as well (no
by Sebb767 5y ago
In case anyone else wonders how the code in the linked tweet [0] would format your hard drive, it's the missing return on f1. Therefore, f1 is empty as well (no ret) and calling it will result in f2 being run. The commented out code is irrelevant.
EDIT: Reading the bug report [1], the actual cause for the missing ret is that the for loop will overflow, which is UB and causes clang to not emit any code for the function.
[0] https://twitter.com/m13253/status/1371615680068526081 https://twitter.com/m13253/status/1371615680068526081
[1] https://bugs.llvm.org/show_bug.cgi?id=49599 https://bugs.llvm.org/show_bug.cgi?id=49599