summaryrefslogtreecommitdiff
path: root/psi
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2023-02-14 17:15:02 +0000
committerChris Liddell <chris.liddell@artifex.com>2023-02-14 18:33:26 +0000
commit259931a3e22f678c48c5082ff91222a9b17b94ee (patch)
tree7273de7ece31b38c7fe431c1196c465ffcef3886 /psi
parent4edf4a7dc86e39a2882cd391936bb6a14694c65d (diff)
downloadghostpdl-259931a3e22f678c48c5082ff91222a9b17b94ee.tar.gz
Use appropriate attributes for ref pointing to text enumerator
In order to facilitate exiting to the interpreter during text operations (such as show, stringwidth etc) we store the text enumerator in an opaque Postscript object on the execution stack. Postscript refs have an attribute indicating what VM mode the object they reference lives in (local, global or "system"). One of the places that uses that is the garbage collector - if we're gc-ing local VM, we ignore refs with the global attribute. The problem is, we *always* allocate the text enumerator in local VM, but we set the ref attributes with the current VM mode, meaning the enumerator would never get marked by the garbager, and could be freed prematurely by the sweep. Explicitly set the attributes to reflect the actual VM mode used to create the enumerator. Stems from work related to Bug 706368
Diffstat (limited to 'psi')
-rw-r--r--psi/zchar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/psi/zchar.c b/psi/zchar.c
index d4527db0e..207f79aa3 100644
--- a/psi/zchar.c
+++ b/psi/zchar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2022 Artifex Software, Inc.
+/* Copyright (C) 2001-2023 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -675,7 +675,8 @@ op_show_finish_setup(i_ctx_t *i_ctx_p, gs_text_enum_t * penum, int npop,
make_null(&essfont(ep));
make_null(&esrfont(ep));
make_op_estack(&eseproc(ep), endproc);
- make_istruct(ep, 0, penum);
+ /* The text enumerators are always allocated in local VM */
+ make_struct(ep, iimemory_local->space, penum);
esp = ep;
return 0;
}