Skip to content

Commit

Permalink
Add in some missing I32 store opcodes (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejrgilbert authored Jan 7, 2025
1 parent 8fa7a5d commit e5489c2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ir/module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ impl<'a> Module<'a> {
// If it is a new one
if curr_rg != last_rg {
// If the previous one was an explicit rec group
if let Some(_) = last_rg {
if last_rg.is_some() {
// Encode the last one as a recgroup
types.ty().rec(rg_types.clone());
// Reset the vector
Expand All @@ -1090,7 +1090,7 @@ impl<'a> Module<'a> {
last_rg = curr_rg;
}
// If the last rg was a none, it was encoded in the binary, if it was an explicit rec group, was not encoded
if let Some(_) = last_rg {
if last_rg.is_some() {
types.ty().rec(rg_types.clone());
}
module.section(&types);
Expand Down
1 change: 0 additions & 1 deletion src/ir/module/module_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ impl<'a> Functions<'a> {
/// Iterate over functions present in the module
///
/// Note: Functions returned by this iterator *may* be deleted.
#[must_use]
pub fn iter(&self) -> impl Iterator<Item = &Function<'a>> {
Iter::<Function<'a>>::iter(self)
}
Expand Down
8 changes: 8 additions & 0 deletions src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,14 @@ pub trait Opcode<'a>: Inject<'a> {
self.inject(Operator::I32Store { memarg });
self
}
fn i32_store8(&mut self, memarg: MemArg) -> &mut Self {
self.inject(Operator::I32Store8 { memarg });
self
}
fn i32_store16(&mut self, memarg: MemArg) -> &mut Self {
self.inject(Operator::I32Store16 { memarg });
self
}

/// load 1 byte and sign-extend i8 to i64
fn i64_load8_s(&mut self, memarg: MemArg) -> &mut Self {
Expand Down

0 comments on commit e5489c2

Please sign in to comment.