diff options
-rw-r--r-- | Mac/Python/macglue.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index 8b3d6e1..240fc01 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -410,10 +410,13 @@ PyMac_Error(OSErr err) int PyOS_CheckStack() { - long left; + char here; + static char *sentinel = 0; - left = StackSpace(); - if ( left < MINIMUM_STACK_SIZE ) + if ( sentinel == 0 ) { + sentinel = &here - StackSpace() + MINIMUM_STACK_SIZE; + } + if ( &here < sentinel ) return -1; return 0; } |