How to validate Python bytecode? -


I'm thinking of manipulating some bytecokes in Python (think genetic programming).

In the case of a test of the Python source tree that came out, which states:

The broken bytecode objects can easily crash the interpreter. is.

The question is, how to validate the given tweed byte code that it will not crash the interpreter? Is this also possible?

Test source,

  cc = (lambda fc = (lambda n: [c for c] .__ class __.__bas____ [0] .__ subclasses__ () If c .___name__ == n] [0]): FC ("function") (fc ("code") (0, 0, 0, 0, "kaboom", (), (), () , Defines this module as  cc , that if it is called,   

code> mymod.cc () crash interpreter One very difficult example is creating a new code object with custom bytecode "KABOOM" and then runs it.

I accept something Confirms the predefined bytecode, e.g.,

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -