<?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>293105</bug_id>
          
          <creation_ts>2025-05-15 23:10:01 -0700</creation_ts>
          <short_desc>Wasm module compile error when a function contains `try_table` after `return`</short_desc>
          <delta_ts>2025-05-16 14:49:47 -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>New Bugs</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>293106</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>seyoon1705</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2117555</commentid>
    <comment_count>0</comment_count>
      <attachid>475261</attachid>
    <who name="">seyoon1705</who>
    <bug_when>2025-05-15 23:10:01 -0700</bug_when>
    <thetext>Created attachment 475261
return_try_table.js

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>2117739</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2025-05-16 14:49:47 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 293106 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>475261</attachid>
            <date>2025-05-15 23:10:01 -0700</date>
            <delta_ts>2025-05-15 23:10:01 -0700</delta_ts>
            <desc>return_try_table.js</desc>
            <filename>return_try_table.js</filename>
            <type>application/x-javascript</type>
            <size>810</size>
            <attacher>seyoon1705</attacher>
            
              <data encoding="base64">J3VzZSBzdHJpY3QnOwoKZnVuY3Rpb24gbW9kdWxlKGJ5dGVzLCB2YWxpZCA9IHRydWUpIHsKICBs
ZXQgYnVmZmVyID0gbmV3IEFycmF5QnVmZmVyKGJ5dGVzLmxlbmd0aCk7CiAgbGV0IHZpZXcgPSBu
ZXcgVWludDhBcnJheShidWZmZXIpOwogIGZvciAobGV0IGkgPSAwOyBpIDwgYnl0ZXMubGVuZ3Ro
OyArK2kpIHsKICAgIHZpZXdbaV0gPSBieXRlcy5jaGFyQ29kZUF0KGkpOwogIH0KICBsZXQgdmFs
aWRhdGVkOwogIHRyeSB7CiAgICB2YWxpZGF0ZWQgPSBXZWJBc3NlbWJseS52YWxpZGF0ZShidWZm
ZXIpOwogIH0gY2F0Y2ggKGUpIHsKICAgIHRocm93IG5ldyBFcnJvcigiV2FzbSB2YWxpZGF0ZSB0
aHJvd3MiKTsKICB9CiAgaWYgKHZhbGlkYXRlZCAhPT0gdmFsaWQpIHsKICAgIGlmICghdmFsaWRh
dGVkKSBXZWJBc3NlbWJseS5jb21waWxlKGJ1ZmZlcikuY2F0Y2goZSA9PiBkZWJ1ZyhlKSk7CiAg
IC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