fix: root: alloc_objects: range boundary judge error

This commit is contained in:
Paul Pan 2024-06-15 17:49:10 +08:00
parent 705fb217fd
commit 61fefde82c

View File

@ -162,7 +162,7 @@ fn alloc_objects<T: KernelObject + ?Sized>(
let (memory, epilogue) = remain.split_at_mut(end_idx - untyped_start); let (memory, epilogue) = remain.split_at_mut(end_idx - untyped_start);
match range { match range {
r if r.end < untyped_start => (memory, &mut prologue[r]), r if r.end <= untyped_start => (memory, &mut prologue[r]),
r if r.start >= end_idx => (memory, &mut epilogue[(r.start - end_idx)..(r.end - end_idx)]), r if r.start >= end_idx => (memory, &mut epilogue[(r.start - end_idx)..(r.end - end_idx)]),
_ => panic!("init: slot range overlaps with untyped memory"), _ => panic!("init: slot range overlaps with untyped memory"),
} }