Odin: sharedness not properly tracked by some import constructs

RESOLVED FIXED in Firefox 41

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: lth, Assigned: lth)

Tracking

(Blocks 1 bug)

unspecified
mozilla41
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment)

Consider this fragment:

    "use asm";

    var yabba = stdlib.SharedInt32Array;
    var i32a = new yabba(heap);

Loaded in the shell with -w, this fails with a compilation error:

warning: asm.js type error: stdlib has different sharedness than previous view constructors:
warning:     var i32a = new yabba(heap);
warning: ...................^

The underlying reason for that seems to be that in CheckNewArrayView, in the case for a non-dotted name, the local variable "shared" is not properly set to take into account information about the global that is being used in the constructor call.

Indeed it's not obvious that that global carries the necessary information.

The slightly confusing error message comes about because the presence of SharedInt32Array on the previous line sets a module-global flag that says "views must be shared".
I was a little torn here about whether to track the sharedness with the global, but in the end that seemed marginally cleaner than going to the module.
Attachment #8622439 - Flags: review?(luke)
Assignee: nobody → lhansen
Attachment #8622439 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/f5ce4d1cb3c2
Status: NEW → RESOLVED
Closed: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.