Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Quirk committed Jan 14, 2025
1 parent f95c3bb commit 9f4fc20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 8 additions & 5 deletions rust/sword/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,6 @@ pub fn interpret(context: &mut Context, mut subject: Noun, formula: Noun) -> Res
match nock {
Ok(res) => Ok(res),
Err(err) => {
eprintln!("calling exit");
Err(exit(context, &snapshot, virtual_frame, err))
}

Expand Down Expand Up @@ -1209,16 +1208,20 @@ fn exit(
let h = *(stack.local_noun_pointer(0));
// XX: Small chance of clobbering something important after OOM?
// XX: what if we OOM while making a stack trace
eprintln!("interpret: deterministic: h={:?}", h);
eprintln!("interpret: deterministic: t={:?}", t);
weld(stack, t, h).expect("weld failed")
match weld(stack, t, h) {
Ok(trace) => trace,
Err(_) => h
}
},
Error::NonDeterministic(_, t) | Error::ScryCrashed(t) => {
// Return $tang of traces
let h = *(stack.local_noun_pointer(0));
// XX: Small chance of clobbering something important after OOM?
// XX: what if we OOM while making a stack trace
T(stack, &[h, t])
match weld(stack, t, h) {
Ok(trace) => trace,
Err(_) => h
}
}
};

Expand Down
4 changes: 1 addition & 3 deletions rust/sword/src/jets/nock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ pub fn jet_mute(context: &mut Context, subject: Noun) -> Result {
_ => panic!("serf: mook: invalid toon"),
}
}
Err(err) =>{
Err(JetErr::Fail(err))
}
Err(err) => Err(JetErr::Fail(err))
}
}

Expand Down

0 comments on commit 9f4fc20

Please sign in to comment.