Closed Bug 669434 Opened 8 years ago Closed 8 years ago

CompileFileHelper bugs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: brendan, Assigned: njn)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch fixes w/o tests (obsolete) — Splinter Review
Free patch attached, needs tests. The bogus assertion is tripped by, e.g.,

$ echo "1 + 2" > /tmp/3.js
$ ./DBG/js < /tmp/3.js

and the buffer overrun is triggered by, e.g. (and this may be the only way),

$ ./DBG/js -f /dev/zero

Free fix to unsightly lack of vertical space in JS_InitStandardClasses included. Nick, can you add tests and land?

/be
Attachment #544030 - Flags: review?(nnethercote)
(In reply to comment #0)
> Nick, can you add tests and land?

Sure, thanks for finding.
Attached patch patch, v2Splinter Review
Same as Brendan's patch, but with an extra comment.

I have no idea how to invoke these two commands with our testing scripts:

  js < foo.js

  js -f /dev/zero

Waldo, do you know?
Attachment #544030 - Attachment is obsolete: true
Attachment #544393 - Flags: feedback?(jwalden+bmo)
Attachment #544030 - Flags: review?(nnethercote)
Make a C++ test using jsapi-tests? Or maybe add /dev/zero to a jstest.list for jstests?
Comment on attachment 544393 [details] [diff] [review]
patch, v2

(In reply to comment #3)
> Make a C++ test using jsapi-tests? Or maybe add /dev/zero to a jstest.list
> for jstests?

The latter doesn't work, because jstests.py requires the entries in jstest.list be relative paths.  The former would work but seems overkill, and adds an extra .cpp file to builds.

Brendan, I think the best option is to not bother testing.  The |js < foo.js| case was a trivial incorrect assertion, and the |js -f /dev/zero| case could only happen with files that lied about their size;  the only ones I know about like that are /dev/zero and /dev/random.  What do you think?
Attachment #544393 - Flags: feedback?(jwalden+bmo) → review?(brendan)
Comment on attachment 544393 [details] [diff] [review]
patch, v2

Ideally we'd use Python's noted ability to handle full pathnames, check for /dev/zero, etc., but it's not important right now. Thanks,

/be
Attachment #544393 - Flags: review?(brendan) → review+
http://hg.mozilla.org/mozilla-central/rev/a8224422f7c6
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.