Open Bug 1398816 Opened 8 years ago Updated 1 year ago

Function.prototype.caller leaks replacement function from asm.js HandleInstantiationFailure to content

Categories

(Core :: JavaScript Engine: JIT, defect, P5)

defect

Tracking

()

REOPENED
Tracking Status
firefox57 --- wontfix

People

(Reporter: anba, Unassigned)

References

(Blocks 1 open bug)

Details

Test case: --- function fn(stdlib, foreign, buffer){ "use asm"; var values = new stdlib.Float64Array(buffer); function main() { return 0; } return {main: main}; }; var badstdlib = { Float64Array: function f() { var clonedFn = f.caller; print(clonedFn === fn); } }; var foreign = {}; var buffer = new ArrayBuffer(2**16); fn(badstdlib, foreign, buffer); --- Expected: Prints "true" Actual: Prints "false" When asm.js linking fails, [1] creates a replacement function to proceed the call (or construct). This replacement function is an implementation detail and should probably not be accessible to content code. [1] http://searchfox.org/mozilla-central/rev/00fa5dacedb925022f53d025121f1a919508e7ce/js/src/wasm/AsmJS.cpp#8074-8076
Heh, yeah, this bug goes back to 2013; probably the 'fix' will be the removal of the asm.js optimization. On the bright side, iirc, f.caller is not specified?
(In reply to Luke Wagner [:luke] from comment #1) > Heh, yeah, this bug goes back to 2013; probably the 'fix' will be the > removal of the asm.js optimization. Agreed, I don't think it's worthwhile to spend time fixing this issue. :-) > On the bright side, iirc, f.caller is not specified? Yes, it's not specified.
Priority: -- → P5
Severity: normal → S3

This seems to be working now.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME

It still prints false for me. Is my shell build too old?

Flags: needinfo?(mgaudet)

... Oh, I missed a warning message when I tested in devtools (no available wasm compiler); I too get false in the shell.

Blocks: sm-runtime
Status: RESOLVED → REOPENED
Flags: needinfo?(mgaudet)
Resolution: WORKSFORME → ---
You need to log in before you can comment on or make changes to this bug.