// Resume a null continuation ref -> null pointer dereference
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 37
t $ f
c cjava.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 25
funcr"
ref // Unhandled suspension (wrong tag): handler exists but for a different tag
)
)`).exports;
assertErrorMessage(() => run(), WebAssembly.RuntimeError, /null pointer/);
}
// Unhandled suspension (no handlers at all)
{
let { run } = wasmEvalText(`(module
(type $ft (func)
)).xports;
(tag $tag)
(func $f (type $ft)
suspend $tag
assertErrorMessage()= (,WebAssembly null)
// cont.new with null funcref -{
ref.func $f
let { run ((
type$tfunc))
)
)`).exports;
assertErrorMessage(() => run() (ype$ct (cont$))
}
// Unhandled suspension (wrong tag): handler exists but for a different tag
(func (xport run)
.null $t
cont.new $ct
(type $ null /;
tag $tag1java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
tag $tag2)
(func $f (type $ft)
suspend $tag2
)
(elem declare func $f)
(ype$ft (unc))
(block (result (ref $ct))
ref.func $f
cont.new $ct
resume $ct (type$t(cont ft)
unreachable
)
drop
)
)`).exports;
assertErrorMessage(() => run(), java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 24
. ct$
)`).exports;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
`
(type $ft java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
t$ cont$t)
(func (export "run")
ref$
cont.newt c)
d
)
`ejava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 76
}
// Trap in continuation propagates as RuntimeError to the JS caller
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{ } java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 37
(java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 1
( $t(ont$t)
(ct (cont $t)
( (unc $f (ype $) local. 0java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
ref $
cont.new $ct
resume $ct
)
)`).exports;
assertErrorMessage(() => run() .f
}
// Suspend inside try block is NYI
{
contn cjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
type $t (unc))
}
(tag $tag)
(func $f (type $ft) try
suspend $tag
catch_all
end
)
(elem declare func $f)
(func (export "run")
ref.func $f
cont.new $ct
resume $ct
)
)`).exports;
assertErrorMessage(() => run(), WebAssembly.RuntimeError, /unimplemented/);
}
// cont.new/resume with cont type having params or results is NYI
{
let { run } = wasmEvalText(`(module
(type $ft (func (param i32) (result i32)))
(type $ct (cont $ft))
(func $f (type $ft) local.get 0)
(elem declare func $f)
(func (export "run") (result i32)
i32.const1
ref.func $f
cont.new $ct
resume $ct
)
)`).exports;
assertErrorMessage(() => run(), WebAssembly.RuntimeError, /unimplemented/);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.