blob: 198d229491b143548a5b244bac80ac9ba59b21ad [file] [log] [blame]
Thomas Wouters0e3f5912006-08-11 14:57:12 +00001"""
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
Ezio Melotti5683a3d2010-01-16 15:11:38 +000017co = types.CodeType(0, 0, 0, 0, 0, b'\x04\x71\x00\x00',
18 (), (), (), '', '', 1, b'')
Georg Brandl7cae87c2006-09-06 06:51:57 +000019exec(co)