PostScript programmer should not worry about the local variables affecting the normal operation of the PS interpreter. Unfortunately, this is not the case when resourcas are not bound. Attached is a patch for the ColorSpace category. Probably, we need a test case that enumerates all resource categories, enumerates and loads all resources and checks, whether the resource is affected by the definition in userdict.
Created attachment 838 [details] patch for Default* color spaces.
The 'bind' operator only recursively binds procedures, so the patch doesn't do anything: - /DecodeLMN [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ] def + /DecodeLMN [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ] bind def should be: - /DecodeLMN [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ] def + /DecodeLMN [ { 1.8 exp } bind { 1.8 exp } bind { 1.8 exp } bind ] def or for conciseness: - /DecodeLMN [ { 1.8 exp } { 1.8 exp } { 1.8 exp } ] def + /DecodeLMN [ { 1.8 exp } bind dup dup ] def
The following experiment shows that the original patch works although "{ 1.8 exp } bind dup dup" is better indeed. GS>[{add}] bind == [{--add--}]
The modified patch is committed to the HEAD branch.
Created attachment 862 [details] Test case load-allres.ps Attached is a test file that enumerates all resources in all categories, loads themand searches for executable names. The test shows that many names in Font CIDFont and related resource categories are not bound.
Seems like Alex has a handle on this and if he or anyone else wants to do the (sort of tedious) work, we will pay the bounty.
Created attachment 1059 [details] patch Bind all operators, true, false, null, =string, systemdict, globaldict, userdict in all gs_*.ps files.
*** Bug 687928 has been marked as a duplicate of this bug. ***
Rev. 12268 has finally changed all null, true, and false to immediately evaluated names. There may be other cases of name look-up but none have caused any problems so far.