Skip to content

Commit

Permalink
revert change on refnull
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuoguo committed Nov 27, 2024
1 parent f347473 commit 1079b28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions benchmarks/wasm/wasmfx/resume2.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(module
(type $f1 (func (result i32)))
(type $c1 (cont $f1))
(func $f42 (result i32) (i32.const 42))
(elem declare func $f42)
(func (export "main") (result i32)
(resume $c1 (cont.new $c1 (ref.func $f42)))
)
)
4 changes: 2 additions & 2 deletions src/main/scala/wasm/AST.scala
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ trait Callable

// https://webassembly.github.io/function-references/core/exec/runtime.html
abstract class Ref extends Value with Callable
case class RefNullV() extends Ref {
def tipe(implicit m: ModuleInstance): ValueType = ???
case class RefNullV(t: HeapType) extends Ref {
def tipe(implicit m: ModuleInstance): ValueType = RefType(t)
}
case class RefFuncV(funcAddr: Int) extends Ref {
def tipe(implicit m: ModuleInstance): ValueType =
Expand Down

0 comments on commit 1079b28

Please sign in to comment.