4 ms·
You're doing fine work! > I found dozens of bugs by just taking a large preprocessed C++ file, deleting a few lines, and then when finding a segfault, reducing
by MaxBarraclough 8y ago
You're doing fine work!
> I found dozens of bugs by just taking a large preprocessed C++ file, deleting a few lines, and then when finding a segfault, reducing by deleting lines and tokens until I reached a minimal example of the same error
To run with this idea: this process could be automated, and applied to any number of different compilers.
Out of curiosity, did these bugs tend to be things like buffer-overflows? How many of the bugs you reported do you think would have been avoided had the compiler been written in a 'safe' language rather than C++?
- CJefferson 8y agoActually, many of the bugs were asserts triggering (segfault isn't quite right). In the case of C++, there are just so many weird states the compiler can find itself in, particularly in the case of clang which tries hard to produce good errors, so keeps parsing even after an error has been found.
- MaxBarraclough 8y ago> many of the bugs were asserts triggering I'd say that's the best kind of bug. Reflects well on the codebase. C++ parsing is an infamously untidy problem.