This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients eric.snow, larry, ncoghlan, serhiy.storchaka
Date 2017-12-30.14:05:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za>
In-reply-to
Content
The information provided by PyCompile_OpcodeStackEffect() and dis.stack_effect() (added in issue19722) is not enough for practical use.

1. Some opcodes (like JUMP_IF_TRUE_OR_POP or FOR_ITER) have different stack effect when when execution is continued from the following opcode or jumped to the address specified by oparg. Thus there are two different values for stack effect of these opcodes.

2. Some opcodes (RETURN_VALUE, RAISE_VARARGS) stops execution. Their stack effect doesn't have meaning, and the following opcodes should be ignored.

3. Some opcodes (JUMP_ABSOLUTE, JUMP_RELATIVE) always jump. The opcodes following them should be ignored.

4. Some opcodes (like SETUP_FINALLY or SETUP_WITH) need additional space on the stack for raised exceptions. Their stack effect is virtual. Its value can't be used for calculating the actual position on the stack. This isn't documented.

The possible solution is to add a boolean flag for distinguishing the stack effects in case of consequent execution and jumping. Return a special sentinel or raise an exception if the opcode doesn't pass execution in this direction.
History
Date User Action Args
2017-12-30 14:05:46serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan, larry, eric.snow
2017-12-30 14:05:46serhiy.storchakasetmessageid: <1514642746.19.0.213398074469.issue32455@psf.upfronthosting.co.za>
2017-12-30 14:05:46serhiy.storchakalinkissue32455 messages
2017-12-30 14:05:45serhiy.storchakacreate