Skip to content

Commit

Permalink
Removes derive(Copy) from Config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Jul 25, 2024
1 parent f3758ec commit 33c0880
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn get_runtime_environment_key() -> i32 {
}

/// VM configuration settings
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Config {
/// Maximum call depth
pub max_call_depth: usize,
Expand Down
72 changes: 36 additions & 36 deletions tests/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ fn test_err_dynamic_stack_out_of_bound() {
"
stb [r10-0x3001], 0
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(1),
Expand All @@ -1972,7 +1972,7 @@ fn test_err_dynamic_stack_out_of_bound() {
"
stb [r10], 0
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(1),
Expand Down Expand Up @@ -2027,7 +2027,7 @@ fn test_dynamic_stack_frames_empty() {
function_foo:
mov r0, r10
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -2049,7 +2049,7 @@ fn test_dynamic_frame_ptr() {
function_foo:
mov r0, r10
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand All @@ -2067,7 +2067,7 @@ fn test_dynamic_frame_ptr() {
function_foo:
exit
",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand Down Expand Up @@ -2130,7 +2130,7 @@ fn test_stack_call_depth_tracking() {
function_foo:
exit
",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand Down Expand Up @@ -2338,7 +2338,7 @@ fn test_bpf_to_bpf_depth() {
add64 r1, -1
call function_foo
exit",
config,
config.clone(),
[max_call_depth as u8],
(),
TestContextObject::new(max_call_depth as u64 * 4 - 2),
Expand Down Expand Up @@ -3452,7 +3452,7 @@ fn test_lddw() {
"
lddw r0, 0x1122334455667788
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(2),
Expand All @@ -3462,7 +3462,7 @@ fn test_lddw() {
"
lddw r0, 0x0000000080000000
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(2),
Expand All @@ -3481,7 +3481,7 @@ fn test_lddw() {
add r0, r1
exit
",
config,
config.clone(),
[],
(),
TestContextObject::new(9),
Expand All @@ -3495,7 +3495,7 @@ fn test_lddw() {
callx r8
lddw r0, 0x1122334455667788
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -3509,7 +3509,7 @@ fn test_lddw() {
callx r8
lddw r0, 0x1122334455667788
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand All @@ -3526,7 +3526,7 @@ fn test_lddw() {
lddw r0, 0x1122334455667788
exit
",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand All @@ -3542,7 +3542,7 @@ fn test_lddw() {
lddw r0, 0x1122334455667788
exit
",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand Down Expand Up @@ -3574,7 +3574,7 @@ fn test_le() {
ldxh r0, [r1]
le16 r0
exit",
config,
config.clone(),
[0x22, 0x11],
(),
TestContextObject::new(3),
Expand All @@ -3585,7 +3585,7 @@ fn test_le() {
ldxdw r0, [r1]
le16 r0
exit",
config,
config.clone(),
[0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88],
(),
TestContextObject::new(3),
Expand All @@ -3596,7 +3596,7 @@ fn test_le() {
ldxw r0, [r1]
le32 r0
exit",
config,
config.clone(),
[0x44, 0x33, 0x22, 0x11],
(),
TestContextObject::new(3),
Expand All @@ -3607,7 +3607,7 @@ fn test_le() {
ldxdw r0, [r1]
le32 r0
exit",
config,
config.clone(),
[0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88],
(),
TestContextObject::new(3),
Expand Down Expand Up @@ -3637,7 +3637,7 @@ fn test_neg() {
mov32 r0, 2
neg32 r0
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand All @@ -3648,7 +3648,7 @@ fn test_neg() {
mov r0, 2
neg r0
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand All @@ -3659,7 +3659,7 @@ fn test_neg() {
mov32 r0, 3
sub32 r0, 1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand Down Expand Up @@ -3714,7 +3714,7 @@ fn test_mul() {
mov r0, 3
mul32 r0, 4
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand All @@ -3726,7 +3726,7 @@ fn test_mul() {
mov r1, 4
mul32 r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -3738,7 +3738,7 @@ fn test_mul() {
mov r1, 4
mul32 r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -3749,7 +3749,7 @@ fn test_mul() {
mov r0, 0x40000001
mul r0, 4
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand All @@ -3761,7 +3761,7 @@ fn test_mul() {
mov r1, 4
mul r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand Down Expand Up @@ -3792,7 +3792,7 @@ fn test_div() {
lddw r1, 0x100000004
div32 r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -3803,7 +3803,7 @@ fn test_div() {
lddw r0, 0x10000000c
div32 r0, 4
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand All @@ -3815,7 +3815,7 @@ fn test_div() {
mov r1, 4
div32 r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -3827,7 +3827,7 @@ fn test_div() {
lsh r0, 32
div r0, 4
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(4),
Expand All @@ -3840,7 +3840,7 @@ fn test_div() {
mov r1, 4
div r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand All @@ -3852,7 +3852,7 @@ fn test_div() {
mov32 r1, 0
div r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand Down Expand Up @@ -3885,7 +3885,7 @@ fn test_mod() {
mov32 r1, 13
mod32 r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(5),
Expand All @@ -3896,7 +3896,7 @@ fn test_mod() {
lddw r0, 0x100000003
mod32 r0, 3
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand All @@ -3913,7 +3913,7 @@ fn test_mod() {
mod r0, r1
mod r0, 0x658f1778
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(9),
Expand All @@ -3925,7 +3925,7 @@ fn test_mod() {
mov32 r1, 0
mod r0, r1
exit",
config,
config.clone(),
[],
(),
TestContextObject::new(3),
Expand Down

0 comments on commit 33c0880

Please sign in to comment.