ยปCore Development>Code coverage>Lib/test/crashers/bogus_code_obj.py

Python code coverage for Lib/test/crashers/bogus_code_obj.py

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