Summary: | Immediately Evaluated Names result in /syntaxerror in --execute-- | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Ryan <rep> |
Component: | PS Interpreter | Assignee: | Alex Cherepanov <alex> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | christinedelight.top85, dns, ray.johnston, shailesh.mistry |
Priority: | P4 | ||
Version: | 8.57 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: | patch |
Description
Ryan
2007-07-30 11:15:00 UTC
I confirm the problem in the current HEAD on both Linux and Windows platforms. Operators implemented in C are not affected by the bug but everything else is. This first broke in r6912; I've assigned the bug accordingly. While low priority, this is Alex's area now and he's made many improvements to address the name binding in our PS code. Bug still reproducible in Ghostscript 9.03 Ray, please review the logic. We allocate %statementedit in the system memory. When a is read from the command prompt we use gs_scan_token() to determine, whether the line has a complete token. If the line has immediately evaluated names, gs_scan_token() fails. This is interpreted as the end of the input. If the line buffer has a complete token, the buffer is rescanned and everything is fine. Otherwise, scanning a prematurely closed buffer causes an error. All we need to do to fix this is to force local memory allocation instead of inheriting system memory from %statementedit. The scanned token is discarded anyway. Created attachment 8158 [details]
patch
The changes to use system VM were made to cure JOBSERVER issues with some allocations in local _and_ global VM being restored (freed) by a restore to the outermost save level. If, as you say, "The scanned token is discarded anyway.", then this patch should be fine. Testing -dJOBSERVER mode from gswin32c with input from stdin would show up the problems (ref bug 688312 and 201952) as described in commit: commit 3ac6e994cdf2f7065465082f2f90458d61afd92f Author: Ray Johnston <ray.johnston@artifex.com> Date: Fri Jun 30 20:00:21 2006 +0000 Changes to make the JOBSERVER and exitserver operate correctly. This is essential to proper CET and FTS execution. If the command line input still works from stdin, then please commit your patch. The patch has been committed as: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=2f12f569672d84a1846905c41701fca52f8dc55e |