We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd8cfd4 commit 4353cd1Copy full SHA for 4353cd1
crates/wasmi/src/engine/translator/translator2/utils.rs
@@ -1,3 +1,20 @@
1
+/// Bail out early in case the current code is unreachable.
2
+///
3
+/// # Note
4
5
+/// - This should be prepended to most Wasm operator translation procedures.
6
+/// - If we are in unreachable code most Wasm translation is skipped. Only
7
+/// certain control flow operators such as `End` are going through the
8
+/// translation process. In particular the `End` operator may end unreachable
9
+/// code blocks.
10
+macro_rules! bail_unreachable {
11
+ ($this:ident) => {{
12
+ if !$this.reachable {
13
+ return Ok(());
14
+ }
15
+ }};
16
+}
17
+
18
/// Implemented by types that can be reset for reuse.
19
pub trait Reset {
20
/// Resets `self` for reuse.
0 commit comments