Hacker News new | ask | show | jobs
by lieks 582 days 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";
    }
1 comments

That’s golden!

Can even make it half the size with an instruction that is invalid in 64bit mode, maybe such as INTO

And that instruction can be removed too: zero byte ".text" section -> page fault