summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2023-04-28 06:41:04 +0100
committerChris Liddell <chris.liddell@artifex.com>2023-04-28 07:01:25 +0100
commite1750d4385e0d7fa56044cf1ed3d377478f72d27 (patch)
tree4d7053d06d43919363d2a0ab08c10093eb0be47c
parentfc2f216537216654521b86dc26be4ce88837b8e0 (diff)
downloadghostpdl-e1750d4385e0d7fa56044cf1ed3d377478f72d27.tar.gz
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
-rw-r--r--psi/int.mak2
-rw-r--r--psi/zpdfops.c2
2 files changed, 3 insertions, 1 deletions
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