@@ -27,25 +27,16 @@ _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg,
27
27
PyObject * jump )
28
28
/*[clinic end generated code: output=64a18f2ead954dbb input=461c9d4a44851898]*/
29
29
{
30
- int effect ;
31
30
int oparg_int = 0 ;
32
31
int jump_int ;
33
- if (HAS_ARG (opcode )) {
34
- if (oparg == Py_None ) {
35
- PyErr_SetString (PyExc_ValueError ,
36
- "stack_effect: opcode requires oparg but oparg was not specified" );
37
- return -1 ;
38
- }
32
+
33
+ if (oparg != Py_None ) {
39
34
oparg_int = (int )PyLong_AsLong (oparg );
40
35
if ((oparg_int == -1 ) && PyErr_Occurred ()) {
41
36
return -1 ;
42
37
}
43
38
}
44
- else if (oparg != Py_None ) {
45
- PyErr_SetString (PyExc_ValueError ,
46
- "stack_effect: opcode does not permit oparg but oparg was specified" );
47
- return -1 ;
48
- }
39
+
49
40
if (jump == Py_None ) {
50
41
jump_int = -1 ;
51
42
}
@@ -60,11 +51,10 @@ _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg,
60
51
"stack_effect: jump must be False, True or None" );
61
52
return
A36C
-1 ;
62
53
}
63
- effect = PyCompile_OpcodeStackEffectWithJump (opcode , oparg_int , jump_int );
54
+ int effect = PyCompile_OpcodeStackEffectWithJump (opcode , oparg_int , jump_int );
64
55
if (effect == PY_INVALID_STACK_EFFECT ) {
65
- PyErr_SetString (PyExc_ValueError ,
66
- "invalid opcode or oparg" );
67
- return -1 ;
56
+ PyErr_SetString (PyExc_ValueError , "invalid opcode or oparg" );
57
+ return -1 ;
68
58
}
69
59
return effect ;
70
60
}
0 commit comments