Skip to content
Snippets Groups Projects
Commit 390df8b5 authored by Zejun Wu's avatar Zejun Wu Committed by Ben Gamari
Browse files

Fix uninformative hp2ps error when the cmdline contains double quotes

The format of hp file didn't allow double quotes inside strings, and
under prof build, we include args in JOB, which may have double quotes.
When this happens, the error message is confusing to the user. This can
also happen under normal build if the executable name contains double
quite, which is unlikely though.

We fix this issue by introducing escaping for double quotes inside a
string by repeating it twice.

We also fix a buffer overflow bug when the length of the string happen
to be multiple of 5000.

Test Plan:
new tests, which used to fail with error message:

```
hp2ps: "T15904".hp, line 2: integer must follow identifier
```

use new ghc and hp2ps to profile a simple program.

Reviewers: simonmar, bgamari, erikd

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: #15904

Differential Revision: https://phabricator.haskell.org/D5346
parent 599eaada
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment