Re:Choose Firefox Now, or Later You Won't Get a Choice (2014)
by lern_too_spel on Friday December 07, 2018 @09:31PM
(#18633523)
It is trivial to prove that anything that a code generator can emit can be translated into something that an interpreter can interpret. Run the generated code through an interpreter. QED.
Re:Choose Firefox Now, or Later You Won't Get a Choice (2014)
by saagarjha on Saturday December 08, 2018 @02:42AM
(#18634327)
> It is trivial to prove that anything that a code generator can emit can be translated into something that an interpreter can interpret.
That's not what we are trying to prove, though; we're trying to show that the generated code does not perform certain undesirable operations. this is much harder to do with dynamically generated code than static code.
Unless the state of static analysis has somehow changed significantly without me realizing it, no, this does not help at all. While I can (to some extent) verify the code in the code generator itself, I cannot verify that the code generator will not generate arbitrary code unless it lists out all the code it can possibly generate, in which case it's, well, an interpreter. The task of verifying program behavior is now shifted from static analysis on a compiled binary to dynamic instrumentation of a running program, which is much harder to do.