We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fe0e05 commit 6ac4f73Copy full SHA for 6ac4f73
src/policy/sft_map.rs
@@ -182,9 +182,13 @@ mod space_map {
182
}
183
184
fn get_checked(&self, address: Address) -> &dyn SFT {
185
- // We should be able to map the entire address range to indices in the table.
186
- debug_assert!(Self::addr_to_index(address) < self.sft.len());
187
- unsafe { self.get_unchecked(address) }
+ if self.has_sft_entry(address) {
+ // We should be able to map the entire address range to indices in the table.
+ debug_assert!(Self::addr_to_index(address) < self.sft.len());
188
+ unsafe { self.get_unchecked(address) }
189
+ } else {
190
+ &EMPTY_SPACE_SFT
191
+ }
192
193
194
unsafe fn get_unchecked(&self, address: Address) -> &dyn SFT {
0 commit comments