Skip to content

Commit

Permalink
Tweak definition of Mstore inst
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Nak committed Oct 13, 2024
1 parent e86f356 commit 63aa359
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/ir/src/inst/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ impl_inst_write!(Mload, (addr: ValueId, ty: Type));
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Inst)]
#[inst(side_effect(super::SideEffect::Write))]
pub struct Mstore {
#[inst(value)]
value: ValueId,
#[inst(value)]
addr: ValueId,
#[inst(value)]
value: ValueId,
ty: Type,
}
impl_inst_write!(Mstore, (value: ValueId, addr: ValueId, ty: Type));
Expand Down
2 changes: 1 addition & 1 deletion crates/ir/src/interpret/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ impl Interpret for Mstore {
fn interpret(&self, state: &mut dyn State) -> EvalValue {
state.set_action(Action::Continue);

let value = state.lookup_val(*self.addr());
let addr = state.lookup_val(*self.addr());
let value = state.lookup_val(*self.value());
state.store(addr, value, *self.ty())
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/parser/src/inst/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use smallvec::SmallVec;
use crate::{ast, error::ArityBound, BuildCtx, Error};

super::impl_inst_build! {Mload, has_mload, (addr: ValueId, ty: Type)}
super::impl_inst_build! {Mstore, has_mstore, (value: ValueId, addr: ValueId, ty: Type)}
super::impl_inst_build! {Mstore, has_mstore, (addr: ValueId, value: ValueId, ty: Type)}
super::impl_inst_build_common! {Gep, has_gep, ArityBound::AtLeast(2), build_gep}

fn build_gep(
Expand Down

0 comments on commit 63aa359

Please sign in to comment.