Skip to content

Commit

Permalink
Merge pull request #366 from Jafaral/deref-tended
Browse files Browse the repository at this point in the history
runtime: fix gc issue, deref() can trigger gc
  • Loading branch information
Don-Ward authored Mar 4, 2024
2 parents 4348a58 + b0d917c commit 75c54a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/runtime/cnv.r
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,11 @@ cnv_tstr_macro(cnv_tstr,0,0,0,0,0)
void f(dptr s, dptr d)
{
/*
* no allocation is done, so nothing need be tended.
* deref() can alloc, bp and v need to be tended.
* ep is initiliazed and used with no allocation in between, it is safe.
*/
register union block *bp;
struct descrip v;
tended union block *bp;
tended struct descrip v;
register union block **ep;
int res;
Expand All @@ -674,7 +675,7 @@ void f(dptr s, dptr d)
* the string.
*/
bp = BlkLoc(*s);
deref(&Blk(bp,Tvsubs)->ssvar, &v);
deref(&Blk(bp,Tvsubs)->ssvar, &v);
if (!is:string(v))
fatalerr(103, &v);
if (Blk(bp,Tvsubs)->sspos + Blk(bp,Tvsubs)->sslen - 1 > StrLen(v))
Expand Down

0 comments on commit 75c54a4

Please sign in to comment.