Closed Bug 1172517 Opened 8 years ago Closed 8 years ago
Odin: sharedness not properly tracked by some import constructs
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)
You need to log in before you can comment on or make changes to this bug.