remove redundant return value Ok(()) of clear_relocations()
This commit is contained in:
parent
85bd00fd85
commit
393878b15b
1 changed files with 3 additions and 10 deletions
|
@ -266,7 +266,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
|
||||||
let range = self.check_bounds(ptr.offset, size);
|
let range = self.check_bounds(ptr.offset, size);
|
||||||
|
|
||||||
self.mark_init(ptr, size, true);
|
self.mark_init(ptr, size, true);
|
||||||
self.clear_relocations(cx, ptr, size)?;
|
self.clear_relocations(cx, ptr, size);
|
||||||
|
|
||||||
AllocationExtra::memory_written(self, ptr, size)?;
|
AllocationExtra::memory_written(self, ptr, size)?;
|
||||||
|
|
||||||
|
@ -484,18 +484,13 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
|
||||||
/// uninitialized. This is a somewhat odd "spooky action at a distance",
|
/// uninitialized. This is a somewhat odd "spooky action at a distance",
|
||||||
/// but it allows strictly more code to run than if we would just error
|
/// but it allows strictly more code to run than if we would just error
|
||||||
/// immediately in that case.
|
/// immediately in that case.
|
||||||
fn clear_relocations(
|
fn clear_relocations(&mut self, cx: &impl HasDataLayout, ptr: Pointer<Tag>, size: Size) {
|
||||||
&mut self,
|
|
||||||
cx: &impl HasDataLayout,
|
|
||||||
ptr: Pointer<Tag>,
|
|
||||||
size: Size,
|
|
||||||
) -> InterpResult<'tcx> {
|
|
||||||
// Find the start and end of the given range and its outermost relocations.
|
// Find the start and end of the given range and its outermost relocations.
|
||||||
let (first, last) = {
|
let (first, last) = {
|
||||||
// Find all relocations overlapping the given range.
|
// Find all relocations overlapping the given range.
|
||||||
let relocations = self.get_relocations(cx, ptr, size);
|
let relocations = self.get_relocations(cx, ptr, size);
|
||||||
if relocations.is_empty() {
|
if relocations.is_empty() {
|
||||||
return Ok(());
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -517,8 +512,6 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
|
||||||
|
|
||||||
// Forget all the relocations.
|
// Forget all the relocations.
|
||||||
self.relocations.remove_range(first..last);
|
self.relocations.remove_range(first..last);
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Errors if there are relocations overlapping with the edges of the
|
/// Errors if there are relocations overlapping with the edges of the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue