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