mirror of
https://github.com/urbit/ares.git
synced 2024-11-22 15:08:54 +03:00
trace: fix invalid event names
This commit is contained in:
parent
f5889bba17
commit
d67dad2a0b
@ -139,8 +139,15 @@ pub unsafe fn write_nock_trace(
|
||||
}
|
||||
|
||||
let pc = path_to_cord(stack, (*trace_stack).path);
|
||||
let pclen = met3_usize(pc);
|
||||
let pc_str = &pc.as_bytes()[0..pclen];
|
||||
let pc_len = met3_usize(pc);
|
||||
let pc_bytes = &pc.as_bytes()[0..pc_len];
|
||||
let pc_str = match std::str::from_utf8(pc_bytes) {
|
||||
Ok(valid) => valid,
|
||||
Err(error) => {
|
||||
let (valid, _) = pc_bytes.split_at(error.valid_up_to());
|
||||
unsafe { std::str::from_utf8_unchecked(valid) }
|
||||
}
|
||||
};
|
||||
|
||||
assert_no_alloc::permit_alloc(|| {
|
||||
let obj = object! {
|
||||
|
Loading…
Reference in New Issue
Block a user