Skip to content

Commit add48f2

Browse files
committed
only run test on rust guest
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent b95cce1 commit add48f2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/hyperlight_host/tests/integration_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ fn recursive_stack_allocate_overflow() {
495495

496496
#[test]
497497
fn read_invalid_address() {
498-
let sbox1: SingleUseSandbox = new_uninit().unwrap().evolve(Noop::default()).unwrap();
498+
let sbox1: SingleUseSandbox = new_uninit_rust().unwrap().evolve(Noop::default()).unwrap();
499499

500500
let res = sbox1
501501
.call_guest_function_by_name("MmioRead", ReturnType::Int, None)

src/tests/rust_guests/simpleguest/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,7 @@ fn add(function_call: &FunctionCall) -> Result<Vec<u8>> {
727727
// Used to test the behavior of the sandbox when reading from an invalid address.
728728
// Currently, the vm will exit with an MMIO exit
729729
fn mmio_read(_: &FunctionCall) -> Result<Vec<u8>> {
730-
let ptr: *const i32 = core::ptr::null();
731-
let val = unsafe { *(ptr.add(5000000)) };
730+
let val = unsafe { core::ptr::null::<i32>().add(0x400000).read() };
732731
Ok(get_flatbuffer_result_from_int(val))
733732
}
734733

0 commit comments

Comments
 (0)