PageRenderTime 72ms CodeModel.GetById 40ms app.highlight 1ms RepoModel.GetById 29ms app.codeStats 0ms

/Lib/test/crashers/bogus_code_obj.py

http://unladen-swallow.googlecode.com/
Python | 19 lines | 11 code | 0 blank | 8 comment | 0 complexity | 5e84429cfdb949a97a7c5d77b2eea8ae MD5 | raw file
 1"""
 2Broken bytecode objects can easily crash the interpreter.
 3
 4This is not going to be fixed.  It is generally agreed that there is no
 5point in writing a bytecode verifier and putting it in CPython just for
 6this.  Moreover, a verifier is bound to accept only a subset of all safe
 7bytecodes, so it could lead to unnecessary breakage.
 8
 9For security purposes, "restricted" interpreters are not going to let
10the user build or load random bytecodes anyway.  Otherwise, this is a
11"won't fix" case.
12
13"""
14
15import types
16
17co = types.CodeType(0, 0, 0, 0, '\x04\x71\x00\x00', (),
18                    (), (), '', '', 1, '')
19exec co