diff --git a/document/core/valid/instructions.rst b/document/core/valid/instructions.rst index d92dd7d19..6013d4de2 100644 --- a/document/core/valid/instructions.rst +++ b/document/core/valid/instructions.rst @@ -235,6 +235,9 @@ $${rule-prose: Instr_ok/br_on_cast} $${rule: Instr_ok/br_on_cast} +.. note:: + The existence of a common supertype ${:rt_3} means that ${:rt_1} and ${:rt_2} must be in the same heap subtyping hierarchy. + .. _valid-br_on_cast_fail: @@ -245,6 +248,9 @@ $${rule-prose: Instr_ok/br_on_cast_fail} $${rule: Instr_ok/br_on_cast_fail} +.. note:: + The existence of a common supertype ${:rt_3} means that ${:rt_1} and ${:rt_2} must be in the same heap subtyping hierarchy. + .. _valid-call: diff --git a/specification/wasm-latest/2.3-validation.instructions.spectec b/specification/wasm-latest/2.3-validation.instructions.spectec index e57e5d90f..aa012b18f 100644 --- a/specification/wasm-latest/2.3-validation.instructions.spectec +++ b/specification/wasm-latest/2.3-validation.instructions.spectec @@ -98,7 +98,10 @@ rule Instr_ok/br_on_cast: -- if C.LABELS[l] = t* rt -- Reftype_ok: C |- rt_1 : OK -- Reftype_ok: C |- rt_2 : OK - -- Reftype_sub: C |- rt_2 <: rt_1 + -- Reftype_ok: C |- rt_3 : OK + ---- + -- Reftype_sub: C |- rt_1 <: rt_3 + -- Reftype_sub: C |- rt_2 <: rt_3 -- Reftype_sub: C |- rt_2 <: rt rule Instr_ok/br_on_cast_fail: @@ -106,7 +109,10 @@ rule Instr_ok/br_on_cast_fail: -- if C.LABELS[l] = t* rt -- Reftype_ok: C |- rt_1 : OK -- Reftype_ok: C |- rt_2 : OK - -- Reftype_sub: C |- rt_2 <: rt_1 + -- Reftype_ok: C |- rt_3 : OK + ---- + -- Reftype_sub: C |- rt_1 <: rt_3 + -- Reftype_sub: C |- rt_2 <: rt_3 -- Reftype_sub: C |- $diffrt(rt_1, rt_2) <: rt