Merge pull request #99 from urbit/philip/doublejam

Fix loading from snapshot
This commit is contained in:
Edward Amsden 2023-10-03 17:54:19 -05:00 committed by GitHub
commit 2ceba8cc3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,11 @@ use std::ptr::copy_nonoverlapping;
use std::ptr::write_bytes;
fn main() -> io::Result<()> {
// eprintln!("serf: pid {}", std::process::id());
// if unsafe { libc::kill(std::process::id() as i32, libc::SIGSTOP) } != 0 {
// panic!("Could not stop ourselves.");
// };
let filename = env::args().nth(1).expect("Must provide input filename");
if filename == "see gdb! definition in lib.rs about this" {

View File

@ -78,7 +78,7 @@ impl DoubleJam {
| ((*in_ptr.add(1) as u32) << 8)
| ((*in_ptr.add(2) as u32) << 16)
| ((*in_ptr.add(3) as u32) << 24);
write_bytes(dest.add(word_len as usize - 1), 0, 8);
write_bytes(dest.add(word_len as usize - 1), 0, 1);
copy_nonoverlapping(in_ptr.add(8), dest as *mut u8, in_len as usize);
mem::drop(in_map);
state.normalize(); // know it's not direct because first word is event number