Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception-handling #134

Merged
merged 78 commits into from
Jan 28, 2024
Merged

exception-handling #134

merged 78 commits into from
Jan 28, 2024

Conversation

yamt
Copy link
Owner

@yamt yamt commented Jan 28, 2024

this is based on the latest version of the proposal.

cf. an incomplete attempt based on an older version of proposal: #10

yamt added 30 commits January 24, 2024 21:21
this commit includes:

* fix rebase botches
* add exnref type
* validation for new opcodes
* make a few trace messages a bit easier to read
now the simple cases like the following is working.

```
(module
  (tag $e (param i32))
  (func $g (param i32)
    local.get 0
    throw $e
  )
  (func $f (param i32) (result i32)
    block (result i32)
      try_table (catch $e 0)
        local.get 0
        call $g
      end
      unreachable
    end
  )
  (func (export "_start")
    i32.const 1234
    call $f
    i32.const 1234
    i32.ne
    if
      unreachable
    end
  )
)
```
implement exnref and use it for throw.
to make it easier to implement throw_ref.
this can also save malloc/free.
@yamt yamt mentioned this pull request Jan 28, 2024
@yamt yamt merged commit 20bc55e into master Jan 28, 2024
116 checks passed
@yamt yamt deleted the eh2 branch January 28, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant