CompileFileHelper bugs

RESOLVED FIXED in mozilla8

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: brendan, Assigned: njn)

Tracking

Trunk
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 544030 [details] [diff] [review]
fixes w/o tests

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)
(Assignee)

Comment 1

6 years ago
(In reply to comment #0)
> Nick, can you add tests and land?

Sure, thanks for finding.
(Assignee)

Comment 2

6 years ago
Created attachment 544393 [details] [diff] [review]
patch, v2

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)

Comment 3

6 years ago
Make a C++ test using jsapi-tests? Or maybe add /dev/zero to a jstest.list for jstests?
(Assignee)

Comment 4

6 years ago
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)
(Reporter)

Comment 5

6 years ago
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+
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/a8224422f7c6
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/a8224422f7c6
Status: NEW → RESOLVED
Last Resolved: 6 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.