Summary: | WebAssembly: construct 32-bit encodedJSValue properly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | JF Bastien <jfbastien> | ||||||
Component: | JavaScriptCore | Assignee: | JF Bastien <jfbastien> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | 165805 | ||||||||
Bug Blocks: | 159775 | ||||||||
Attachments: |
|
Description
JF Bastien
2016-12-20 11:52:01 PST
(In reply to comment #0) > Mark pointed out here: https://bugs.webkit.org/show_bug.cgi?id=165805#c3 > That I was using { } to construct default encodedJSValue, and that's wrong > on 32-bit. I think I changed to { } based on a review, but that was wrong. > wasm doesn't do 64-bit, but we may as well Do It Right. I think you mean "wasm doesn't do 32-bit". (In reply to comment #1) > (In reply to comment #0) > > Mark pointed out here: https://bugs.webkit.org/show_bug.cgi?id=165805#c3 > > That I was using { } to construct default encodedJSValue, and that's wrong > > on 32-bit. I think I changed to { } based on a review, but that was wrong. > > wasm doesn't do 64-bit, but we may as well Do It Right. > > I think you mean "wasm doesn't do 32-bit". Oops yes. I'm making this change semi-automatically. First I run: git grep RETURN ./Source/JavaScriptCore/wasm/ | grep "{ })" | cut -f1 -d: | sort -u | xargs -n1 -I{} gsed -i 's/RETURN_IF_EXCEPTION(\([a-zA-Z]*\), { });/RETURN_IF_EXCEPTION(\1, encodedJSValue());/' {} And then I switch back all returns which were actually JSValue (the compiler chokes on these bad conversions). Created attachment 297545 [details]
patch
It compiles and passes all tests!
Comment on attachment 297545 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=297545&action=review r=me with the bug fixed. > Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h:40 > - RETURN_IF_EXCEPTION(throwScope, { }); > + RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); This one is not right. The return type is uint32_t. It's proper to return {} here and wrong to return encodedJSValue(). Created attachment 297553 [details] patch (In reply to comment #5) > Comment on attachment 297545 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=297545&action=review > > r=me with the bug fixed. > > > Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h:40 > > - RETURN_IF_EXCEPTION(throwScope, { }); > > + RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > > This one is not right. The return type is uint32_t. It's proper to return > {} here and wrong to return encodedJSValue(). Oops yes, I hadn't seen that! Good catch. Comment on attachment 297553 [details] patch Clearing flags on attachment: 297553 Committed r210038: <http://trac.webkit.org/changeset/210038> All reviewed patches have been landed. Closing bug. |