diff --git a/fix-vm/src/instructions/arithmetic.rs b/fix-vm/src/instructions/arithmetic.rs index 7095b73..f7de037 100644 --- a/fix-vm/src/instructions/arithmetic.rs +++ b/fix-vm/src/instructions/arithmetic.rs @@ -61,7 +61,7 @@ impl<'gc> crate::Vm<'gc> { #[inline(always)] pub(crate) fn op_div(&mut self, reader: &mut BytecodeReader<'_>, mc: &Mutation<'gc>) -> Step { let (lhs, rhs) = self.try_force::<(StrictValue, StrictValue)>(reader, mc)?; - match (get_num(rhs), get_num(lhs)) { + match (get_num(lhs), get_num(rhs)) { (_, Some(NixNum::Int(0))) | (_, Some(NixNum::Float(0.))) => { return self.finish_vm_err(VmError::Uncatchable(fix_error::Error::eval_error( "division by zero", diff --git a/fix-vm/src/lib.rs b/fix-vm/src/lib.rs index f852448..df32b42 100644 --- a/fix-vm/src/lib.rs +++ b/fix-vm/src/lib.rs @@ -444,19 +444,19 @@ pub(crate) enum NixNum { impl Vm<'_> { pub fn run( - mut ctx: C, + ctx: &mut C, ip: InstructionPtr, force_mode: ForceMode, ) -> Result { let mut arena: Arena]> = - Arena::new(|mc| Vm::new(force_mode, mc, &mut ctx)); + Arena::new(|mc| Vm::new(force_mode, mc, ctx)); const COLLECTOR_GRANULARITY: f64 = 1024.0; let mut pc = ip.0; let bytecode: Vec = ctx.bytecode().to_vec(); loop { - match arena.mutate_root(|mc, root| root.dispatch_batch(&bytecode, &mut ctx, pc, mc)) { + match arena.mutate_root(|mc, root| root.dispatch_batch(&bytecode, ctx, pc, mc)) { Action::Continue { pc: new_pc } => { pc = new_pc; if arena.metrics().allocation_debt() > COLLECTOR_GRANULARITY { diff --git a/fix/src/lib.rs b/fix/src/lib.rs index 446bafa..ca08dab 100644 --- a/fix/src/lib.rs +++ b/fix/src/lib.rs @@ -166,7 +166,7 @@ impl Evaluator { } } -impl VmContext for &mut Evaluator { +impl VmContext for Evaluator { fn intern_string(&mut self, s: impl AsRef) -> StringId { StringId(self.strings.get_or_intern(s)) } diff --git a/flake.lock b/flake.lock index 92b6d32..ff00167 100644 --- a/flake.lock +++ b/flake.lock @@ -46,16 +46,16 @@ ] }, "locked": { - "lastModified": 1776182890, - "narHash": "sha256-+/VOe8XGq5klpU+I19D+3TcaR7o+Cwbq67KNF7mcFak=", - "owner": "Mic92", + "lastModified": 1776192490, + "narHash": "sha256-5gYQNEs0/vDkHhg63aHS5g0IwG/8HNvU1Vr00cElofk=", + "owner": "nix-community", "repo": "bun2nix", - "rev": "648d293c51e981aec9cb07ba4268bc19e7a8c575", + "rev": "6ef9f144616eedea90b364bb408ef2e1de7b310a", "type": "github" }, "original": { - "owner": "Mic92", - "ref": "catalog-support", + "owner": "nix-community", + "ref": "staging-2.1.0", "repo": "bun2nix", "type": "github" } @@ -68,11 +68,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1776413252, - "narHash": "sha256-ZQhyB2vnFsE1KcWJlWle1UujEDVjTJVL3oMIHUvnzuo=", + "lastModified": 1777018861, + "narHash": "sha256-l+dfxHtTq1jQM53xgYudV8ciECFmJ72PcRAqRS4ys04=", "owner": "nix-community", "repo": "fenix", - "rev": "a318c3c6120e91375eea1d7c57a0cd101a81b14a", + "rev": "7b33c6466f781cd699fe250c5b69dc4193da67a7", "type": "github" }, "original": { @@ -143,11 +143,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1776437995, - "narHash": "sha256-wcV5CIe5s2IsSCGJdPqy/Q+gcBSR76JMaIQDNpLXZAk=", + "lastModified": 1777019177, + "narHash": "sha256-YjPvucTsKmGO9QVNz07x7sSsK11PB0jtMniRkTolbq4=", "owner": "numtide", "repo": "llm-agents.nix", - "rev": "c4a2f76e29485eaafc90eebec5ef12b50f4dc8a1", + "rev": "8ff0f2a7fcd176b4547da6879ad549de2bbded41", "type": "github" }, "original": { @@ -158,11 +158,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1776169885, - "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", + "lastModified": 1776548001, + "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9", + "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", "type": "github" }, "original": { @@ -183,11 +183,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1776343166, - "narHash": "sha256-ZiHQPWwuUZk44epAZRbyFz23Kd4CYaq8WlBgAmCqAzQ=", + "lastModified": 1776800521, + "narHash": "sha256-f8YJfwAOsLFpIoqZuX3yF69UvMLrkx7iVzMH1pJU7cM=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "b8458013c217be4fccefc4e4f194026fa04ab4ca", + "rev": "8954b66d43225e62c92e8bbcc8500191b5cceb1e", "type": "github" }, "original": {