The statement "0/0;" is not always compiled out

NEW
Unassigned

Status

()

Core
JavaScript Engine
8 years ago
4 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

(Blocks: 1 bug, {regression, testcase})

Trunk
regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
On the TM branch, jsfunfuzz discovered that whether "0/0;" is compiled out depends on whether the function as a whole is parenthesized.  This makes jsfunfuzz complain a lot, so I'll probably have to turn off its round-trip checking until this bug is fixed.

Maybe this is related to constant-folding and caused by bug 537673?

With parens:

js> (function() { (function b() {0 / 0;})(); })
(function () {(function b() {0 / 0;}());})

Without parens:

js> function () {(function b() {0 / 0;}());}
function () {(function b() {}());}
Hmm, yeah, we should be hopping down a level or two, not skipping it entirely at that point.
(Reporter)

Comment 2

7 years ago
Waldo, ping? We're missing a lot of jsfunfuzz coverage because of this bug.
The js shell errors out now if the function isn't enclosed in parentheses. Is there another way to test this or is this no longer valid?

Not sure if this is really equivalent, but when I use print(), I get the following:
js> print((function () {(function b() {0 / 0;}());}))
function () {
    (function b() {}());
}
js> print(function () {(function b() {0 / 0;}());})
function () {
    (function b() {}());
OS: Mac OS X → All
Hardware: x86 → All
(Reporter)

Comment 4

6 years ago
I can still reproduce the bug, like this:

js> print(function() { (function b() {0 / 0;})(); })
function () {
    (function b() {0 / 0;}());
}

js> print((function () {(function b() {0 / 0;}());}))
function () {
    (function b() {}());
}
(Reporter)

Comment 5

5 years ago
With the decompiler gone, this bug no longer bites jsfunfuzz.  But it's still present, as can be seen with:

dis("-r", function() { (function b() {0 / 0;})(); })
dis("-r", (function () {(function b() {0 / 0;}());}))
(Assignee)

Updated

4 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.