You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should be accepted, but fails with the following error message:
invalid module: type mismatch: instruction requires [i32 (ref null (cont 0))] but stack has [i32 (ref 1)]
Removing the "sub" from the definitions of $ct0 and $ct1 makes the problem go away.
The culprit seems to be our usage of heap_type_of_str_type in valid.ml. This conversion function was introduced by us and is only used for the validation of WasmFX instructions. It turns a structural type into a heap type by turning it into a final subtype with an empty list of supertypes, and then puts that subtype definition into a singleton group of recursive types.
I suspect that this also affects code combining recursive types and WasmFX instruction, as it throws away information about the members of recursive type groups. We can probably get rid of heap_type_of_str_type altogether and obtain the desired heap types in a different way.
The text was updated successfully, but these errors were encountered:
I agree, that function seems wrong and should never be used. Instead of heap_type_of_str_type (FuncT/ContT t), these rules should use VarHT (StatX x), where x is the type index from which the structural type was expanded before.
Note that the wasm-3.0+exn branch is no longer needed and now subsumed by wasm-3.0.
PS: I think syncing with wasm-3.0 is somewhat independent of this particular issue.
There seems to be a validation problem when WasmFX instructions non-final types.
Consider the following program:
This should be accepted, but fails with the following error message:
Removing the "
sub
" from the definitions of$ct0
and$ct1
makes the problem go away.The culprit seems to be our usage of
heap_type_of_str_type
in valid.ml. This conversion function was introduced by us and is only used for the validation of WasmFX instructions. It turns a structural type into a heap type by turning it into afinal
subtype with an empty list of supertypes, and then puts that subtype definition into a singleton group of recursive types.I suspect that this also affects code combining recursive types and WasmFX instruction, as it throws away information about the members of recursive type groups. We can probably get rid of
heap_type_of_str_type
altogether and obtain the desired heap types in a different way.The text was updated successfully, but these errors were encountered: