Skip to content

Commit

Permalink
stack_effect() for specialized opcode is an error
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Feb 8, 2023
1 parent 977e639 commit bd19d79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,10 @@ static int
stack_effect(int opcode, int oparg, int jump)
{
if (0 <= opcode && opcode < 256) {
if (_PyOpcode_Deopt[opcode] != opcode) {
// Specialized instructions are not supported.
return PY_INVALID_STACK_EFFECT;
}
int popped, pushed;
if (jump > 0) {
popped = _PyOpcode_num_popped(opcode, oparg, true);
Expand Down

0 comments on commit bd19d79

Please sign in to comment.