From bd19d798842155d5e4c73ba5b6aff25b5eff0c76 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 8 Feb 2023 15:14:24 -0800 Subject: [PATCH] stack_effect() for specialized opcode is an error --- Python/compile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Python/compile.c b/Python/compile.c index f1f95b886762e8..061b6d3f6461c1 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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);