From 3a20141bfb21ded78213c35fe1f9dafcfac2be6c Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Mon, 17 Jul 2023 08:54:30 -0500 Subject: [PATCH] Update to new GC cast instruction encoding --- crates/wast/src/core/binary.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/wast/src/core/binary.rs b/crates/wast/src/core/binary.rs index 507ef330e1..6c87449494 100644 --- a/crates/wast/src/core/binary.rs +++ b/crates/wast/src/core/binary.rs @@ -1173,7 +1173,7 @@ impl Encode for RefCast<'_> { } } -fn br_on_cast_flags(on_fail: bool, from_nullable: bool, to_nullable: bool) -> u8 { +fn br_on_cast_flags(from_nullable: bool, to_nullable: bool) -> u8 { let mut flag = 0; if from_nullable { flag |= 1 << 0; @@ -1181,9 +1181,6 @@ fn br_on_cast_flags(on_fail: bool, from_nullable: bool, to_nullable: bool) -> u8 if to_nullable { flag |= 1 << 1; } - if on_fail { - flag |= 1 << 2; - } flag } @@ -1192,7 +1189,6 @@ impl Encode for BrOnCast<'_> { e.push(0xfb); e.push(0x4f); e.push(br_on_cast_flags( - false, self.from_type.nullable, self.to_type.nullable, )); @@ -1207,7 +1203,6 @@ impl Encode for BrOnCastFail<'_> { e.push(0xfb); e.push(0x4f); e.push(br_on_cast_flags( - true, self.from_type.nullable, self.to_type.nullable, ));