Thomas Wouters | 0e3f591 | 2006-08-11 14:57:12 +0000 | [diff] [blame] | 1 | """ |
| 2 | Broken bytecode objects can easily crash the interpreter. |
| 3 | |
| 4 | This is not going to be fixed. It is generally agreed that there is no |
| 5 | point in writing a bytecode verifier and putting it in CPython just for |
| 6 | this. Moreover, a verifier is bound to accept only a subset of all safe |
| 7 | bytecodes, so it could lead to unnecessary breakage. |
| 8 | |
| 9 | For security purposes, "restricted" interpreters are not going to let |
| 10 | the user build or load random bytecodes anyway. Otherwise, this is a |
| 11 | "won't fix" case. |
| 12 | |
| 13 | """ |
| 14 | |
| 15 | import types |
| 16 | |
Ezio Melotti | 5683a3d | 2010-01-16 15:11:38 +0000 | [diff] [blame^] | 17 | co = types.CodeType(0, 0, 0, 0, 0, b'\x04\x71\x00\x00', |
| 18 | (), (), (), '', '', 1, b'') |
Georg Brandl | 7cae87c | 2006-09-06 06:51:57 +0000 | [diff] [blame] | 19 | exec(co) |