Skip to content

Commit

Permalink
Merge branch 'status' into eamsden/flog
Browse files Browse the repository at this point in the history
  • Loading branch information
eamsden authored Mar 13, 2024
2 parents 3ef1f7c + 3863c5f commit 16c4c05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rust/ares/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,13 +1185,19 @@ fn exit(
unsafe {
context.restore(snapshot);

if context.stack.copying() {
assert!(context.stack.get_frame_pointer() != virtual_frame);
context.stack.frame_pop();
}

let stack = &mut context.stack;
let mut preserve = match error {
Error::ScryBlocked(path) => path,
Error::Deterministic(_, t) | 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])
}
};
Expand Down
4 changes: 4 additions & 0 deletions rust/ares/src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ impl NockStack {
};
}

pub fn copying(&self) -> bool {
self.pc
}

/** Current frame pointer of this NockStack */
pub fn get_frame_pointer(&self) -> *const u64 {
self.frame_pointer
Expand Down
1 change: 1 addition & 0 deletions rust/ares_pma/c-src/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,7 @@ _pending_flist_merge(BT_state *state)
src_head = src_head->next;
free(prev);
}
state->pending_flist = 0;
}


Expand Down

0 comments on commit 16c4c05

Please sign in to comment.