File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
graalpython/com.oracle.graal.python.cext Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,12 @@ extern void _PyEval_DeactivateOpCache(void);
111
111
/* With USE_STACKCHECK macro defined, trigger stack checks in
112
112
_Py_CheckRecursiveCall() on every 64th call to _Py_EnterRecursiveCall. */
113
113
static inline int _Py_MakeRecCheck (PyThreadState * tstate ) {
114
- return (tstate -> recursion_remaining -- <= 0
115
- || (tstate -> recursion_remaining & 63 ) == 0 );
114
+ return (tstate -> c_recursion_remaining -- <= 0
115
+ || (tstate -> c_recursion_remaining & 63 ) == 0 );
116
116
}
117
117
#else
118
118
static inline int _Py_MakeRecCheck (PyThreadState * tstate ) {
119
- return tstate -> recursion_remaining -- <= 0 ;
119
+ return tstate -> c_recursion_remaining -- <= 0 ;
120
120
}
121
121
#endif
122
122
@@ -138,7 +138,7 @@ static inline int _Py_EnterRecursiveCall(const char *where) {
138
138
}
139
139
140
140
static inline void _Py_LeaveRecursiveCallTstate (PyThreadState * tstate ) {
141
- tstate -> recursion_remaining ++ ;
141
+ tstate -> c_recursion_remaining ++ ;
142
142
}
143
143
144
144
static inline void _Py_LeaveRecursiveCall (void ) {
Original file line number Diff line number Diff line change @@ -2370,10 +2370,10 @@ _Py_Dealloc(PyObject *op)
2370
2370
destructor dealloc = type -> tp_dealloc ;
2371
2371
#ifdef Py_DEBUG
2372
2372
PyThreadState * tstate = _PyThreadState_GET ();
2373
- PyObject * old_exc_type = tstate -> curexc_type ;
2373
+ PyObject * old_exc = tstate != NULL ? tstate -> current_exception : NULL ;
2374
2374
// Keep the old exception type alive to prevent undefined behavior
2375
2375
// on (tstate->curexc_type != old_exc_type) below
2376
- Py_XINCREF (old_exc_type );
2376
+ Py_XINCREF (old_exc );
2377
2377
// Make sure that type->tp_name remains valid
2378
2378
Py_INCREF (type );
2379
2379
#endif
@@ -2386,12 +2386,12 @@ _Py_Dealloc(PyObject *op)
2386
2386
#ifdef Py_DEBUG
2387
2387
// gh-89373: The tp_dealloc function must leave the current exception
2388
2388
// unchanged.
2389
- if (tstate -> curexc_type != old_exc_type ) {
2389
+ if (tstate != NULL && tstate -> current_exception != old_exc ) {
2390
2390
const char * err ;
2391
- if (old_exc_type == NULL ) {
2391
+ if (old_exc == NULL ) {
2392
2392
err = "Deallocator of type '%s' raised an exception" ;
2393
2393
}
2394
- else if (tstate -> curexc_type == NULL ) {
2394
+ else if (tstate -> current_exception == NULL ) {
2395
2395
err = "Deallocator of type '%s' cleared the current exception" ;
2396
2396
}
2397
2397
else {
You can’t perform that action at this time.
0 commit comments