Skip to content

Unreachable

TIP

This can be configured. Read more about configuration.

This detects unreachable code, for example those code after br, br_table, return and unreachable instructions or infinite loops:

wasm
(module
  (func
    (loop ;; infinite loop
      br 0)
    nop)
  (func
    return
    nop))
wasm
(module
  (func
    (nop)
    (i32.add
      (nop)
      (unreachable
        (i32.const 1))
      (i32.const 0))
    (drop)
    (nop)))