[Webkit-unassigned] [Bug 168857] New: WebAssembly: exporting a property with a name that's a number doesn't work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 24 16:51:58 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=168857

            Bug ID: 168857
           Summary: WebAssembly: exporting a property with a name that's a
                    number doesn't work
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jfbastien at apple.com
                CC: jfbastien at apple.com, keith_miller at apple.com,
                    mark.lam at apple.com, msaboff at apple.com,
                    sbarati at apple.com, utatane.tea at gmail.com
            Blocks: 159775

The following test in test_Instance.js fails but shouldn't:

(function ExportedNumber() {
    for (let i = 0; i <= 129; ++i) {
        const name = i.toString();
        const builder = (new Builder())
             .Type().End()
             .Function().End()
             .Export()
                 .Function(name)
             .End()
             .Code()
                 .Function(name, { params: [], ret: "i32" })
                 .I32Const(i)
                 .Return()
             .End()
             .End();
        const bin = builder.WebAssembly().get();
        const module = new WebAssembly.Module(bin);
        const instance = new WebAssembly.Instance(module);
        const result = instance.exports[name]();
        assert.isA(result, "number");
        assert.eq(result, i);
    }
})();

If you prefix `name` with another string, everything works. I think the issue has to do with using AbstractModuleRecord, somewhere after:

        symbolTablePutTouchWatchpointSet(moduleEnvironment, state, exp.field, exportedValue, shouldThrowReadOnlyError, ignoreReadOnlyErrors, putResult);

exp.field is being put in properly, but then the ModuleRecord mapping is sad at string such as "0".

I'm adding this test, commented out, and leaving a FIXME. The spec tests have a similar failure.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170225/4f710d0c/attachment.html>


More information about the webkit-unassigned mailing list