summaryrefslogtreecommitdiffstats
path: root/Modules/_opcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_opcode.c')
-rw-r--r--Modules/_opcode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_opcode.c b/Modules/_opcode.c
index d8de076..609a262 100644
--- a/Modules/_opcode.c
+++ b/Modules/_opcode.c
@@ -59,7 +59,12 @@ _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg,
"stack_effect: jump must be False, True or None");
return -1;
}
- effect = PyCompile_OpcodeStackEffectWithJump(opcode, oparg_int, jump_int);
+ if (IS_ARTIFICIAL(opcode)) {
+ effect = PY_INVALID_STACK_EFFECT;
+ }
+ else {
+ effect = PyCompile_OpcodeStackEffectWithJump(opcode, oparg_int, jump_int);
+ }
if (effect == PY_INVALID_STACK_EFFECT) {
PyErr_SetString(PyExc_ValueError,
"invalid opcode or oparg");