MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / fetch_out_of_bounds

Function fetch_out_of_bounds

crates/virtual-machine/tests/vm_fetch.rs:48–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46
47 let result = fetch(&mut bus, 0x8000_0001, 0, PrivilegeMode::Machine, 0);
48 assert!(matches!(
49 result,
50 Err(VmError::InstructionAccessFault(0x8000_0001))
51 ));
52}
53
54#[test]
55fn fetch_out_of_bounds() {
56 let mut bus = SystemBus::new(Vec::new());
57
58 // Address outside any mapped region
59 let result = fetch(&mut bus, 0xFFFF_FFFF, 0, PrivilegeMode::Machine, 0);
60 assert!(matches!(

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected