Skip to content

Failing testcase after changing the default type system to isorecursive #5294

Closed
@kripken

Description

@kripken

Bisection found #5239

853b31ec89416bef0014e06f2defaef74f47b81e is the first bad commit                               
commit 853b31ec89416bef0014e06f2defaef74f47b81e                                                
Author: Thomas Lively <tlively@google.com>                                                     
Date:   Tue Nov 22 20:48:58 2022 -0600                                                         
                                                                                               
    Change the default type system to isorecursive (#5239)                                     
                                                                                               
    This makes Binaryen's default type system match the WasmGC spec.                           
                                                                                               
    Update the way type definitions without supertypes are printed to reduce the               
    output diff for MVP tests that do not involve WasmGC. Also port some                       
    type-builder.cpp tests from test/example to test/gtest since they needed to be             
    rewritten to work with isorecursive type anyway.                                           
                                                                                               
    A follow-on PR will remove equirecursive types completely.                                 

Testcase:

(module
 (rec
  (type $none_=>_none (func))
  (type $[i8] (array i8))
  (type $ref|array|_=>_i32 (func (param (ref array)) (result i32)))
  (type $none_=>_i32 (func (result i32)))
  (type $f32_=>_f32 (func (param f32) (result f32)))
  (type $f64_=>_f64 (func (param f64) (result f64)))
 )
 (global $global$0 (mut i32) (i32.const 10))
 (func $0 (type $ref|array|_=>_i32) (param $0 (ref array)) (result i32)
  (global.set $global$0
   (i32.const 1)
  )
  (i32.const -113)
 )
 (func $1 (type $none_=>_none)
  (drop
   (call $0
    (array.init_static $[i8])
   )
  )
 )
 (func $2 (type $none_=>_none)
  (drop
   (call $3)
  )
 )
 (func $3 (type $none_=>_i32) (result i32)
  (return_call $0
   (select (result (ref array))
    (ref.as_non_null
     (ref.null none)
    )
    (array.init_static $[i8])
    (i32.const 0)
   )
  )
 )
)

STR:

$ bin/wasm-opt -all w.wat --gufa --inlining --monomorphize-always
wasm-opt: /usr/local/google/home/azakai/Dev/binaryen/src/wasm-type.h:482: void wasm::Tuple::validate(): Assertion `type.isSingle()' failed.
Aborted

(also happens with --nominal)

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