Skip to content

Are un-exitable blocks ok to ignore? #355

@kripken

Description

@kripken

It's my understanding that it is ok to ignore unreachable code. Does a block whose end is never reached count as unreachable code? Example:

(module
  (func $__Z12serveroptionPc (result i32)
    (block $no-exit
      (return
        (i32.const 0)
      )
    )
  )
)

The block is entered but never exited. The spec interpreter doesn't accept this, but binaryen does (it gives the block type unreachable, just like it would to e.g. (i32.ctz (unreachable))).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions