[comp.lang.postscript] stopped and invalidrestore

pallas@Neon.Stanford.EDU (Joe Pallas) (08/31/89)

I've encountered a peculiar puzzle.  I'm working with a modified
version of Ned Batchelder's bounding-box finder bb.ps.  In the
interest of robustness, this version wraps a ``stopped'' operator
around the pathbbox call, mainly because pathbbox may do
nocurrentpoint even though stroke succeeds.

The problem is that an invalidrestore error gets trapped on a
subsequent restore if and only if the pathbbox did in fact fail.
We're talking about code that basically looks like this:

	{ pathbbox } stopped not { ... } if

In the case where pathbbox doesn't fail, there's no invalidrestore.

It seems as if the trapped error is responsible for the
invalidrestore.  But none of the operand, exec, or dictionary stacks
should be modified in that case.  Is something going into the $error
dictionary that causes the invalidrestore?

More generally, can anyone (preferably from Adobe) tell me what might
be happening and how to work around it?

Thanks.
joe