in reply to Re: Syntax Error Checking
in thread Syntax Error Checking

Be very wary of using this with untrusted data. In the general case, sure, it might be a useful way to see if code compiles cleanly in the event you aren't prepared to execute it yet, but DO NOT use this method as any form of secure "compile only" test. What if the user provided "1 }; system("do something evil");" as their code?

My first thought was to extend this eval method into using a 'reval' with a Safe compartment (with an obscenely strict opcode mask), which would prevent any "extra" code from being executed, but it seems as though the opcode mask is checked at compile time, which means the compilation would fail for legitimate stuff.