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

Not enough unreachability/side-effects tests #1644

Open
SoniEx2 opened this issue Apr 24, 2023 · 2 comments
Open

Not enough unreachability/side-effects tests #1644

SoniEx2 opened this issue Apr 24, 2023 · 2 comments

Comments

@SoniEx2
Copy link
Contributor

SoniEx2 commented Apr 24, 2023

While a real compiler should never emit code like

(module
  (global $a (mut i32) (i32.const 0))

  (func (export "get-a") (result i32) (global.get $a))

  (func $set-and-return-a (result i32) (global.set $a (i32.const 1)) (global.get $a))

  (func (export "call-unreachable") (result i32)
    (call $set-and-return-a)
    (unreachable)
  )
)

(assert_trap (invoke "call-unreachable") "unreachable")
(assert_return (invoke "get-a") (i32.const 1))

it would be nice to see more tests like this.

@rossberg
Copy link
Member

Agreed. The tests in unreachable.wast do not currently test for order of effects.

There are quite a few tests for stack polymorphism, which are in unreached-[in]valid.wast. Your example above is unrelated to stack polymorphism, however, so I don't know what you have in mind in that regard.

@SoniEx2
Copy link
Contributor Author

SoniEx2 commented Apr 25, 2023

hmm we thought we had reported a stack polymorphism bug somewhere but now we don't see it either... 🤷‍♀️

edit: ah, it was in the exception handling proposal.

@SoniEx2 SoniEx2 changed the title Not enough unreachability/side-effects/stack polymorphism tests Not enough unreachability/side-effects tests Apr 25, 2023
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

No branches or pull requests

2 participants