Closed
Bug 878526
Opened 11 years ago
Closed 11 years ago
OdinMonkey: Disallow "return foreignFun();"
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: jruderman, Assigned: luke)
References
Details
(Keywords: testcase)
Attachments
(1 file)
4.72 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
function module(stdlib, foreign) { "use asm"; var kPASS = foreign.kPASS; function f() { return kPASS(); return; } return f; }; print(module(this, {kPASS: function() { return "PASS"; }})()); asm.js result: undefined normal result: PASS OdinMonkey should reject this module saying "unknown is not a subtype of void". I noticed this reading https://bugzilla.mozilla.org/show_bug.cgi?id=846317#c1.
Assignee | ||
Comment 1•11 years ago
|
||
Hah, great corner case. The idea is that "unknown" isn't actually used internally (we'd have to represent the union of a double/int32), but rather the use is propagated inward and that, in turn, determines the ffi call's return type. When there is no coercion, I used the type "void", thinking that there's nothing you can do with a void. However, I forgot the quirk that asm.js lets you return void-valued expressions if the declared return type is void! So, looks like we need Type::Unknown after all since it is not returnable.
Updated•11 years ago
|
Attachment #760071 -
Flags: review?(bbouvier) → review+
Assignee | ||
Comment 2•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9ce9c145e072
Comment 3•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9ce9c145e072
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•