bytecodealliance / wasmtime

A fast and secure runtime for WebAssembly
https://wasmtime.dev/
Apache License 2.0
15.08k stars 1.26k forks source link

isle: panic when rule for non-multi internal constructor calls a multi extern #6756

Open meithecatte opened 1 year ago

meithecatte commented 1 year ago

Consider the following code:

(type u64 (primitive u64))
(decl multi meow (u64) u64)
(extern extractor meow meow)
;; Note: not `multi nyaa`
(decl nyaa (u64) u64)
(rule (nyaa (meow x)) x)

This makes islec panic with the following message:

thread 'main' panicked at 'assertion failed: !block.steps.iter().any(|c| matches!(c.check, ControlFlow :: Loop { .. }))', cranelift/isle/isle/src/codegen.rs:421:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Not sure if that's the standard of error messages we hold islec to.

jameysharp commented 1 year ago

Hah, whoops. That not only should have been caught in an earlier stage, but I left a TODO comment saying so:

https://github.com/bytecodealliance/wasmtime/blob/c9a9c2c1919858057ef51b91dc92216cf13ea477/cranelift/isle/isle/src/sema.rs#L2008

github-actions[bot] commented 3 months ago

Subscribe to Label Action

cc @cfallin, @fitzgen

This issue or pull request has been labeled: "isle" Thus the following users have been cc'd because of the following labels: * cfallin: isle * fitzgen: isle To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file. [Learn more.](https://github.com/bytecodealliance/subscribe-to-label-action)