mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
fix: root: alloc_objects: range boundary judge error
This commit is contained in:
parent
705fb217fd
commit
61fefde82c
@ -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"),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user