luser-dr00g / xpost

A PostScript interpreter in C
Other
93 stars 12 forks source link

`restore` does not close files opened since `save` #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. save (myfile)(w)file
2. restore
3. file should be closed now.

What is the expected output? What do you see instead?

The save/restore mechanism needs an extra record type and behavior to track 
file objects. File creation operators must register their objects with the save 
stack. Restore must close file objects if their Low-Level is above the new 
level.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by luser.droog on 29 Oct 2013 at 5:19

GoogleCodeExporter commented 9 years ago
Steps should be:

 PS> save
 PS<1> (myfile)(w)file
 PS<2> pop %discard file object
 PS<1> restore

(if file-debugging messages are enabled, it should report the file closed here.)

Original comment by luser.droog on 29 Oct 2013 at 7:27

GoogleCodeExporter commented 9 years ago
`restore` should also check the opstack for bad references.

Original comment by luser.droog on 30 Oct 2013 at 9:25