Skip to content

fuzz bug: mismatched if arms after --remove-unused-brs #7128

@tlively

Description

@tlively
;; test.wast
(module
 (global $g anyref (ref.null none))
 (func $test (result anyref)
  (block $block
   (if (result anyref)
    (unreachable)
    (then
     (global.get $g)
    )
    (else
     (br $block)
    )
   )
  )
  (unreachable)
 )
)
wasm-opt -all test.wast --remove-unused-brs
[wasm-validator error in function test] unexpected false: arms of unreachable if-else must have compatible types, on
(if
 (unreachable)
 (then
  (global.get $g)
 )
 (else
  (block $block
   (br $block)
  )
 )
)
Fatal: error after opts

Metadata

Metadata

Assignees

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