3 ms·
Why would it get bigger every time? Did it keep getting bigger if you used the same compiler to compile the source in a loop?
by tedunangst 3y ago
Why would it get bigger every time? Did it keep getting bigger if you used the same compiler to compile the source in a loop?
- Karellen 3y agoThe compiler copies a part of itself directly into the new compiler binary (i.e. it is a type of quine) If a bug causes that copy mechanism to make the "part to be copied" one byte larger than it should be, then each time the compiler compiles itself then that part, and therefor the compiler itself, will be one byte larger than the time before.
- lifeinthevoid 3y agoIt was a bug.
- archi42 3y agoBecause it was a bug. Maybe he always appended a trailing zero byte ('\0') to some string. In general, if you're not aware of the content of the paper, you might want to familiarize yourself with it. In short & maybe simplified: The pre-compiled compiler contains a malware that, when compiling the compiler source, will be insert itself again. (Of course the source does not contain the malware). They used the pre-compiled compiler ("stolen" from Ken) to compile the compiler's source code; this of course inserted the malware into the newly built compiler. Then they used the newly built compiler to compile the compiler's source code again, and so on. And every time they did that, it grew by one byte because of a bug in the malware component.