The default bug view has changed. See this FAQ.

TI: incorrect result with try..catch, loops

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jandem, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

247 bytes, application/x-javascript
Details
(Reporter)

Description

6 years ago
$ ./js -n -m test.js
test.js:5: Error: Assertion failed: got (void 0), expected 0
(Reporter)

Comment 1

6 years ago
Created attachment 527379 [details]
Testcase
The problem here looks like when we enter from the interpreter, we don't fix up the type tags of variables which have a known type, and we then forget the constant type of 'j' after the 'try' so the resulting torn value passed to assertEq looks like an undefined.

This is fixed by the SSA patch, arriving shortly --- it removes the invariant we have that expects known type tags of locals to always be in sync (this invariant doesn't make much sense for SSA, as we can track different types for locals in different regions of the script).  Instead, we avoid stores of type tags for locals/args when we know their type is being preserved by a write, and issue the store when the var may be initially written.  (This could introduce extra memory traffic in nested loops or in branchy loops with vars that are not live around the backedge, but doesn't seem to affect benchmarks.  Could be fixed by not requiring vars with known type to have that type synced at join points).
Fixed by rev 90a7b141e0cf.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.