Skip to content

Commit

Permalink
Increases Config::max_call_depth default from 20 to 64.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed May 28, 2024
1 parent c478374 commit 94ed38d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl Config {
impl Default for Config {
fn default() -> Self {
Self {
max_call_depth: 20,
max_call_depth: 64,
stack_frame_size: 4_096,
enable_address_translation: true,
enable_stack_frame_gaps: true,
Expand Down
8 changes: 4 additions & 4 deletions tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ fn test_err_dynamic_stack_ptr_overflow() {
add r11, -0x7FFFFFFF
add r11, -0x7FFFFFFF
add r11, -0x7FFFFFFF
add r11, -0x14005
add r11, -0x40005
call function_foo
exit
function_foo:
Expand Down Expand Up @@ -2338,7 +2338,7 @@ fn test_bpf_to_bpf_depth() {
exit",
[Config::default().max_call_depth as u8],
(),
TestContextObject::new(78),
TestContextObject::new(254),
ProgramResult::Ok(0),
);
// The instruction count is lower here because all the `exit`s never run
Expand All @@ -2355,7 +2355,7 @@ fn test_bpf_to_bpf_depth() {
exit",
[Config::default().max_call_depth as u8 + 1],
(),
TestContextObject::new(60),
TestContextObject::new(192),
ProgramResult::Err(EbpfError::CallDepthExceeded),
);
}
Expand All @@ -2370,7 +2370,7 @@ fn test_err_reg_stack_depth() {
exit",
[],
(),
TestContextObject::new(60),
TestContextObject::new(192),
ProgramResult::Err(EbpfError::CallDepthExceeded),
);
}
Expand Down

0 comments on commit 94ed38d

Please sign in to comment.