<?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>293106</bug_id>
          
          <creation_ts>2025-05-15 23:10:26 -0700</creation_ts>
          <short_desc>Wasm module compile error when a function contains `try_table` after `return`</short_desc>
          <delta_ts>2025-06-02 06:12: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>WebAssembly</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>seyoon1705</reporter>
          <assigned_to name="Sosuke Suzuki">sosuke</assigned_to>
          <cc>d_degazio</cc>
    
    <cc>keith_miller</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2117556</commentid>
    <comment_count>0</comment_count>
    <who name="">seyoon1705</who>
    <bug_when>2025-05-15 23:10:26 -0700</bug_when>
    <thetext>Commit version: 9d02067f5de4b0402f58d6c83039e206439a8a8c
System: Ubuntu 20.04.6 LTS, x86_64

The following Wasm module contains a function whose body is `return` and `try_table`.
```
;; return_try_table.wat
(module
  (func (return) (try_table))
)
```
It is a valid Wasm module, so it must be succeed to parse and validate.
However, when running `return_try_table.js`, the equivalent JavaScript file, JavaScriptCore raises compile error.

```
$ jsc return_try_table.js
Exception: Error: Wasm validate failure
module@return_try_table.js:17:20
global code@return_try_table.js:23:7
--&gt; CompileError: WebAssembly.Module doesn&apos;t parse at byte 6: function body size doesn&apos;t match the expected size, in function at index 0
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2117557</commentid>
    <comment_count>1</comment_count>
      <attachid>475262</attachid>
    <who name="">seyoon1705</who>
    <bug_when>2025-05-15 23:11:08 -0700</bug_when>
    <thetext>Created attachment 475262
return_try_table.js</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2117740</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2025-05-16 14:49:47 -0700</bug_when>
    <thetext>*** Bug 293105 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2119207</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-05-22 23:20:53 -0700</bug_when>
    <thetext>&lt;rdar://problem/151904860&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2120908</commentid>
    <comment_count>4</comment_count>
    <who name="Sosuke Suzuki">sosuke</who>
    <bug_when>2025-05-31 07:45:10 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/46167</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121096</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-06-02 06:12:46 -0700</bug_when>
    <thetext>Committed 295678@main (70f3c3efa49f): &lt;https://commits.webkit.org/295678@main&gt;

Reviewed commits have been landed. Closing PR #46167 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>475262</attachid>
            <date>2025-05-15 23:11:08 -0700</date>
            <delta_ts>2025-05-15 23:11:08 -0700</delta_ts>
            <desc>return_try_table.js</desc>
            <filename>return_try_table.js</filename>
            <type>application/x-javascript</type>
            <size>810</size>
            <attacher>seyoon1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