From e1750d4385e0d7fa56044cf1ed3d377478f72d27 Mon Sep 17 00:00:00 2001 From: Chris Liddell Date: Fri, 28 Apr 2023 06:41:04 +0100 Subject: Fix pdfi related dict ref object garbage collection Unlike any other object type, ref objects do not have their mark bit unset during the first phase of a garbage collection. They, in fact, require the bit to be unset explicitly at the end of the reloc phase. This was an omission from: https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=b0739b945394ec81a --- psi/int.mak | 2 +- psi/zpdfops.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'psi') diff --git a/psi/int.mak b/psi/int.mak index 0ce29a7fe..ca78caa1f 100644 --- a/psi/int.mak +++ b/psi/int.mak @@ -1812,7 +1812,7 @@ $(PSD)pdfops.dev : $(ECHOGS_XE) $(zpdfops_) $(INT_MAK) $(MAKEDIRS) $(PSOBJ)zpdfops.$(OBJ) : $(PSSRC)zpdfops.c $(OP) $(MAKEFILE)\ $(ghost_h) $(gsmchunk_h) $(oper_h) \ $(igstate_h) $(istack_h) $(iutil_h) $(gspath_h) $(math__h) $(ialloc_h)\ - $(string__h) $(store_h) $(iminst_h) $(idstack_h) $(INT_MAK) $(MAKEDIRS) + $(igc_h) $(string__h) $(store_h) $(iminst_h) $(idstack_h) $(INT_MAK) $(MAKEDIRS) $(PSCC) $(PSO_)zpdfops.$(OBJ) $(C_) $(PSSRC)zpdfops.c zutf8_=$(PSOBJ)zutf8.$(OBJ) diff --git a/psi/zpdfops.c b/psi/zpdfops.c index af93bd06a..d4a470886 100644 --- a/psi/zpdfops.c +++ b/psi/zpdfops.c @@ -42,6 +42,7 @@ #include "gspath.h" #include "math_.h" #include "ialloc.h" +#include "igc.h" /* needed for definition of gc_state for the ref_struct_clear_marks call */ #include "malloc_.h" #include "string_.h" #include "store.h" @@ -462,6 +463,7 @@ ENUM_PTRS_END static RELOC_PTRS_BEGIN(pdfctx_reloc_ptrs); RELOC_REF_VAR(((pdfctx_t *)vptr)->names_dict); +ref_struct_clear_marks(gcst->cur_mem, &(((pdfctx_t *)vptr)->names_dict), 1, pstype); RELOC_PTR3(pdfctx_t, ps_stream, pdf_stream, profile_cache); RELOC_PTRS_END -- cgit v1.2.1