Skip to content

Commit

Permalink
Force null *print-circle* in :prin1 to avoid deadlocks (euslisp#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
Affonso-Gui committed Dec 25, 2022
1 parent 1e322a5 commit be5fabd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lisp/c/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ register context *ctx;
register pointer x;
register pointer f;
register int prlevel;
{ register pointer fobj;
{ register pointer fobj,tmp;
register int shareix=0;
numunion nu;

Expand Down Expand Up @@ -586,6 +586,13 @@ register int prlevel;
else if (Spevalof(PROBJECT)!=NIL) prinxobj(ctx,x,f,fobj,prlevel-1);
else if (pisarray(x) && (classof(x)==C_ARRAY)) printarray(ctx,x,f,prlevel-1);
else if (Spevalof(PRSTRUCTURE)!=NIL) printstructure(ctx,x,f,fobj,prlevel-1);
else if (Spevalof(PRCIRCLE)!=NIL) {
// force NIL to avoid deadlocks (EusLisp/#465)
// TODO: consider :prin1 objects in the initial printmark
tmp=Spevalof(PRCIRCLE);
pointer_update(Spevalof(PRCIRCLE),NIL);
csend(ctx,x,K_PRIN1,1,f);
pointer_update(Spevalof(PRCIRCLE),tmp)}
else csend(ctx,x,K_PRIN1,1,f);
} }

Expand Down

0 comments on commit be5fabd

Please sign in to comment.