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

Avoid holding reference to a GAP bag when NewBag is called. #2294

Merged
merged 1 commit into from
Mar 24, 2018
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
6 changes: 4 additions & 2 deletions src/gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,10 @@ Obj CallErrorInner (
Obj lateMessage,
UInt printThisStatement)
{
Obj EarlyMsg;
// Must do this before creating any other GAP objects,
// as one of the args could be a pointer into a Bag.
Obj EarlyMsg = ErrorMessageToGAPString(msg, arg1, arg2);

Obj r = NEW_PREC(0);
Obj l;
Int i;
Expand All @@ -1186,7 +1189,6 @@ Obj CallErrorInner (
Region *savedRegion = TLS(currentRegion);
TLS(currentRegion) = TLS(threadRegion);
#endif
EarlyMsg = ErrorMessageToGAPString(msg, arg1, arg2);
AssPRec(r, RNamName("context"), STATE(CurrLVars));
AssPRec(r, RNamName("justQuit"), justQuit? True : False);
AssPRec(r, RNamName("mayReturnObj"), mayReturnObj? True : False);
Expand Down