Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | PyDoc_STRVAR(_opcode_stack_effect__doc__, |
| 6 | "stack_effect($module, opcode, oparg=None, /)\n" |
| 7 | "--\n" |
| 8 | "\n" |
| 9 | "Compute the stack effect of the opcode."); |
| 10 | |
| 11 | #define _OPCODE_STACK_EFFECT_METHODDEF \ |
| 12 | {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__}, |
| 13 | |
| 14 | static int |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 15 | _opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg); |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 16 | |
| 17 | static PyObject * |
Serhiy Storchaka | 1a2b24f | 2016-07-07 17:35:15 +0300 | [diff] [blame] | 18 | _opcode_stack_effect(PyObject *module, PyObject *args) |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 19 | { |
| 20 | PyObject *return_value = NULL; |
| 21 | int opcode; |
| 22 | PyObject *oparg = Py_None; |
| 23 | int _return_value; |
| 24 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 25 | if (!PyArg_ParseTuple(args, "i|O:stack_effect", |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 26 | &opcode, &oparg)) { |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 27 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 28 | } |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 29 | _return_value = _opcode_stack_effect_impl(module, opcode, oparg); |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 30 | if ((_return_value == -1) && PyErr_Occurred()) { |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 31 | goto exit; |
Serhiy Storchaka | 5dee655 | 2016-06-09 16:16:06 +0300 | [diff] [blame] | 32 | } |
Serhiy Storchaka | 1009bf1 | 2015-04-03 23:53:51 +0300 | [diff] [blame] | 33 | return_value = PyLong_FromLong((long)_return_value); |
| 34 | |
| 35 | exit: |
| 36 | return return_value; |
| 37 | } |
Serhiy Storchaka | 2954f83 | 2016-07-07 18:20:03 +0300 | [diff] [blame] | 38 | /*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/ |