[Python-checkins] python/dist/src/Python ceval.c, 2.368,
2.369 errors.c, 2.79, 2.80
arigo at users.sourceforge.net
arigo at users.sourceforge.net
Sat Oct 25 10:29:29 EDT 2003
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv20980
Modified Files:
ceval.c errors.c
Log Message:
Made function declaration a proper C prototype
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.368
retrieving revision 2.369
diff -C2 -d -r2.368 -r2.369
*** ceval.c 12 Oct 2003 19:09:37 -0000 2.368
--- ceval.c 25 Oct 2003 14:29:27 -0000 2.369
***************
*** 511,514 ****
--- 511,537 ----
}
+ int
+ _Py_CheckRecursiveCall(char *where)
+ {
+ PyThreadState *tstate = PyThreadState_GET();
+
+ #ifdef USE_STACKCHECK
+ if (PyOS_CheckStack()) {
+ --tstate->recursion_depth;
+ PyErr_SetString(PyExc_MemoryError, "Stack overflow");
+ return -1;
+ }
+ #endif
+ if (tstate->recursion_depth > recursion_limit) {
+ --tstate->recursion_depth;
+ PyErr_Format(PyExc_RuntimeError,
+ "maximum recursion depth exceeded%s",
+ where);
+ return -1;
+ }
+ return 0;
+ }
+
+
/* Status code for main loop (reason for stack unwind) */
***************
*** 675,693 ****
return NULL;
- #ifdef USE_STACKCHECK
- if (tstate->recursion_depth%10 == 0 && PyOS_CheckStack()) {
- PyErr_SetString(PyExc_MemoryError, "Stack overflow");
- return NULL;
- }
- #endif
-
/* push frame */
! if (++tstate->recursion_depth > recursion_limit) {
! --tstate->recursion_depth;
! PyErr_SetString(PyExc_RuntimeError,
! "maximum recursion depth exceeded");
! tstate->frame = f->f_back;
return NULL;
- }
tstate->frame = f;
--- 698,704 ----
return NULL;
/* push frame */
! if (Py_EnterRecursiveCall(""))
return NULL;
tstate->frame = f;
***************
*** 711,717 ****
f, PyTrace_CALL, Py_None)) {
/* Trace function raised an error */
! --tstate->recursion_depth;
! tstate->frame = f->f_back;
! return NULL;
}
}
--- 722,726 ----
f, PyTrace_CALL, Py_None)) {
/* Trace function raised an error */
! goto exit_eval_frame;
}
}
***************
*** 723,729 ****
f, PyTrace_CALL, Py_None)) {
/* Profile function raised an error */
! --tstate->recursion_depth;
! tstate->frame = f->f_back;
! return NULL;
}
}
--- 732,736 ----
f, PyTrace_CALL, Py_None)) {
/* Profile function raised an error */
! goto exit_eval_frame;
}
}
***************
*** 2429,2433 ****
/* pop frame */
! --tstate->recursion_depth;
tstate->frame = f->f_back;
--- 2436,2441 ----
/* pop frame */
! exit_eval_frame:
! Py_LeaveRecursiveCall();
tstate->frame = f->f_back;
Index: errors.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v
retrieving revision 2.79
retrieving revision 2.80
diff -C2 -d -r2.79 -r2.80
*** errors.c 12 Oct 2003 19:09:37 -0000 2.79
--- errors.c 25 Oct 2003 14:29:27 -0000 2.80
***************
*** 600,604 ****
}
! extern PyObject *PyModule_GetWarningsModule();
/* Function to issue a warning message; may raise an exception. */
--- 600,604 ----
}
! extern PyObject *PyModule_GetWarningsModule(void);
/* Function to issue a warning message; may raise an exception. */
More information about the Python-checkins
mailing list