> That section is "Writing Robust Programs." Robustness guarantees have > to be different for utilities and servers. A robust server doesn't > crash because of arbitrary user input, but there are servers that > demangle names that are provided by the user. So we need two modes for > the demangler: one that takes anything and sometimes crashes, for > utilities like c++filt, and one that doesn't crash, for servers. And it > seems like that is what Nick is suggesting.
In order to handle arbitrary user input without crashing, perhaps the demangler should switch from recursive descent parsing to a state machine, where exhaustion of resources can be handled gracefully. -cary