@@ -615,6 +615,9 @@ do { \ |
615 | 615 | assert(SLP_FRAME_EXECUTING_VALUE == f->f_executing); \ |
616 | 616 | if (frame_func != SLP_FRAME_EXECUTING_VALUE) { \ |
617 | 617 | f->f_executing = (frame_func); \ |
| 618 | + /* check argument: must be an executing frame with retval */ \ |
| 619 | + assert(frame_func != SLP_FRAME_EXECUTING_NOVAL); \ |
| 620 | + assert(SLP_FRAME_IS_EXECUTING(f)); \ |
618 | 621 | } \ |
619 | 622 | /* keep the reference to the frame to be called. */ \ |
620 | 623 | f->f_stacktop = stack_pointer; \ |
@@ -3840,11 +3843,15 @@ handle_unwinding(int lineno, PyFrameObject *f, |
3840 | 3843 | const _Py_CODEUNIT *first_instr, const _Py_CODEUNIT *next_instr, |
3841 | 3844 | char frame_func, int has_opcode, PyObject **pretval) |
3842 | 3845 | { |
| 3846 | + assert(*pretval); /* check argument */ |
3843 | 3847 | if (has_opcode) |
3844 | 3848 | next_instr -= 1 + EXTENDED_ARG_OFFSET(oparg); |
3845 | 3849 | assert(SLP_FRAME_EXECUTING_VALUE == f->f_executing); |
3846 | 3850 | if (frame_func != SLP_FRAME_EXECUTING_VALUE) { |
3847 | 3851 | f->f_executing = frame_func; |
| 3852 | + /* check argument: must be an executing frame with retval */ |
| 3853 | + assert(frame_func != SLP_FRAME_EXECUTING_NOVAL); |
| 3854 | + assert(SLP_FRAME_IS_EXECUTING(f)); |
3848 | 3855 | } |
3849 | 3856 | /* keep the reference to the frame to be called. */ |
3850 | 3857 | f->f_stacktop = stack_pointer; |
|