[Python-Dev] Is core dump always a bug? Advice requested

Skip Montanaro skip at pobox.com
Thu May 13 15:35:44 EDT 2004

    Michel>   7. The last instruction must be RETURN_VALUE?

Nope.  Relatively simple analysis of the basic blocks in the bytecode can
determine if the trailing push none/return value pair is dead code and
remove it if it is.

    Michel>   2. The operand of a LOAD_CONST instruction must be an valid
    Michel>      index into the co_consts.

    Michel>   3. Can a similar bounds check be made at verfication time for
    Michel>      LOAD_FAST?

Should be possible, yes.

    Michel>   4. Can index into co_names, co_varnames, co_freevars,
    Michel>      co_cellvars be verfied?

Also yes.  These are all fixed-length arrays (tuples actually) whose lengths
are determined at compile-time.


More information about the Python-Dev mailing list