Skip to content

Commit

Permalink
Update to new GC cast instruction encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
bvisness committed Jul 17, 2023
1 parent 3948ae9 commit 3a20141
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions crates/wast/src/core/binary.rs
Expand Up @@ -1173,17 +1173,14 @@ 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;
}
if to_nullable {
flag |= 1 << 1;
}
if on_fail {
flag |= 1 << 2;
}
flag
}

Expand All @@ -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,
));
Expand All @@ -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,
));
Expand Down

0 comments on commit 3a20141

Please sign in to comment.