<?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>290250</bug_id>
          
          <creation_ts>2025-03-22 01:33:58 -0700</creation_ts>
          <short_desc>ASSERTION FAILED: this-&gt;variant() != StructureVariant::WebAssemblyGC</short_desc>
          <delta_ts>2025-04-06 20:42:08 -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>FIXED</resolution>
          
          
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>katoshi1337</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2105263</commentid>
    <comment_count>0</comment_count>
    <who name="">katoshi1337</who>
    <bug_when>2025-03-22 01:33:58 -0700</bug_when>
    <thetext>Commit:

b12ed39572951123a4b5a99c471e0262e9481001

Command:

./jsc ./poc.js


PoC:


```
load(&quot;wasm-module-builder.js&quot;);
const v4 = new WasmModuleBuilder();
const v17 = [kExprI32Const,42,kGCPrefix,kExprStructNew,v4.addStruct([makeField(kWasmI32, false)]),kGCPrefix,kExprExternConvertAny];

v4.addFunction(&quot;foo&quot;, makeSig([], [kWasmExternRef])).exportFunc().addBody(v17);
globalThis.struct = v4.instantiate().exports.foo();
function f31(a32) {
    a32.prototype = globalThis.struct;
    new a32();
}
function f44() {
}
f31(f44);

```


Output:
```
ASSERTION FAILED: this-&gt;variant() != StructureVariant::WebAssemblyGC
/home/test/WebKit/Source/JavaScriptCore/runtime/Structure.cpp(305) : JSC::Structure::Structure(VM &amp;, StructureVariant, Structure *)

```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2105264</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-03-22 01:34:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/147638735&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109264</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2025-04-06 14:38:24 -0700</bug_when>
    <thetext>Hi! Can you attach wasm-module-builder.js script?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109305</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2025-04-06 17:17:23 -0700</bug_when>
    <thetext>This is ToT issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109306</commentid>
    <comment_count>4</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2025-04-06 17:19:16 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/43722</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2109322</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-04-06 20:42:06 -0700</bug_when>
    <thetext>Committed 293344@main (ccb7cffd3e58): &lt;https://commits.webkit.org/293344@main&gt;

Reviewed commits have been landed. Closing PR #43722 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>