4 ms·
I remember someone quipped that every program always has at least one bug left, and every program could be optimized to be smaller. It follows then that with a
by tzs 2y ago
I remember someone quipped that every program always has at least one bug left, and every program could be optimized to be smaller.
It follows then that with a sufficiently good optimizer every program can be reduced to a single wrong instruction.
- lieks 2y ago/* Optimize a program. May perform unsafe optimizations. May introduce up to 1 bug. */ char *optimize(char *program) { (void) program; return ".export main\nmain:\n\tub2\n"; }
- BobbyTables2 2y agoThat’s golden! Can even make it half the size with an instruction that is invalid in 64bit mode, maybe such as INTO
- rep_lodsb 2y agoAnd that instruction can be removed too: zero byte ".text" section -> page fault
- 082349872349872 2y agoOnce, when a bunch of us were sitting in my office trading debugging[0] war stories, the owner of the company dropped in[1], figured out the convo, and interjected: "That's nothing; I once wrote a single line of assembly that had 3 bugs." then left... [0] we'd gotten to the subject because I was in the midst of using an oscope to decide if my ROM monitor or my libc or both were buggy. [1] perhaps to discover why all the other offices were vacant?