<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>165639</bug_id>
          
          <creation_ts>2016-12-08 17:22:18 -0800</creation_ts>
          <short_desc>webassembly -&gt; JS calls: arity fixup seems to bork value profile</short_desc>
          <delta_ts>2017-05-12 15:54:48 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>171707</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>165591</dependson>
          <blocked>161709</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="JF Bastien">jfbastien</reporter>
          <assigned_to name="JF Bastien">jfbastien</assigned_to>
          <cc>ggaren</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1257971</commentid>
    <comment_count>0</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2016-12-08 17:22:18 -0800</bug_when>
    <thetext>The following test should trigger a crash where we try to check value profiles and get an invalid cell:

(function Polyphic2Import() {
    let counterA = 0;
    let counterB = undefined;
    const counterASetter = v =&gt; { print(&quot;====A===&quot;); counterA = v };
    const counterBSetter = (v, bogus) =&gt; { print(&quot;====B===&quot;); counterB = { valueB: v } };
    const module = wasmModuleWhichImportJS();
    const instanceA = new WebAssembly.Instance(module, { imp: { func: counterASetter } });
    const instanceB = new WebAssembly.Instance(module, { imp: { func: counterBSetter } });
    for (let i = 0; i &lt; 4096; ++i) {
        print(`Iteration ${i} A:`);
        instanceA.exports.changeCounter(i);
        assert.isA(counterA, &quot;number&quot;);
        assert.eq(counterA, i + 42);
        print(`Iteration ${i} B:`);
        instanceB.exports.changeCounter(i);
        assert.isA(counterB, &quot;object&quot;);
        assert.eq(counterB.valueB, i + 42);
    }
})();


Removing the `bogus` arg makes the bug go away.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261763</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-12-20 14:27:47 -0800</bug_when>
    <thetext>&lt;rdar://problem/29760296&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1308123</commentid>
    <comment_count>2</comment_count>
    <who name="Keith Miller">keith_miller</who>
    <bug_when>2017-05-12 15:54:33 -0700</bug_when>
    <thetext>I think this was fixed by https://bugs.webkit.org/show_bug.cgi?id=171707. I&apos;m going to close this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1308124</commentid>
    <comment_count>3</comment_count>
    <who name="Keith Miller">keith_miller</who>
    <bug_when>2017-05-12 15:54:48 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 171707 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>