Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgap: save/restore recursion depth #4258

Merged
merged 1 commit into from
Feb 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libgap-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "ariths.h"
#include "bool.h"
#include "calls.h"
#include "funcs.h"
#include "gap.h"
#include "gapstate.h"
#include "gasman.h"
Expand Down Expand Up @@ -482,6 +483,7 @@ jmp_buf * GAP_GetReadJmpError(void)


static volatile sig_atomic_t EnterStackCount = 0;
static volatile Int RecursionDepth;


// These are wrapped by the macros GAP_EnterStack() and GAP_LeaveStack()
Expand Down Expand Up @@ -517,6 +519,7 @@ int GAP_Error_Prejmp_(const char * file, int line)
if (EnterStackCount > 0) {
return 1;
}
RecursionDepth = GetRecursionDepth();
return 0;
}

Expand All @@ -535,6 +538,7 @@ void GAP_Error_Postjmp_Returning_(void)
if (EnterStackCount > 0) {
EnterStackCount = -EnterStackCount;
}
SetRecursionDepth(RecursionDepth);
}


Expand Down