From 52f5665cf3eac78286b5a89b64f8ce7bdac73ef2 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 8 Nov 2024 19:49:06 -0300 Subject: [PATCH] Test maximum instructions when callx is valid --- tests/execution.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/execution.rs b/tests/execution.rs index fb1b8ffc..41a29a48 100644 --- a/tests/execution.rs +++ b/tests/execution.rs @@ -3499,6 +3499,23 @@ fn callx_unsupported_instruction_and_exceeded_max_instructions() { ); } +#[test] +fn test_maximum_after_callx() { + test_interpreter_and_jit_asm!( + " + mov64 r0, 0x0 + or64 r8, 0x20 + callx r8 + exit + function_foo: + mov64 r0, 0x2A + exit", + [], + TestContextObject::new(3), + ProgramResult::Err(EbpfError::ExceededMaxInstructions), + ); +} + // SBPFv1 only [DEPRECATED] #[test]