diff --git a/script/src/scheduler.rs b/script/src/scheduler.rs index a00e01ce23..8f50dfe7e9 100644 --- a/script/src/scheduler.rs +++ b/script/src/scheduler.rs @@ -493,9 +493,6 @@ where .store64(&length_addr, &actual_length)?; machine.machine.set_register(A0, SUCCESS as u64); } else { - // TODO: in the previous convention - // https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0009-vm-syscalls/0009-vm-syscalls.md#partial-loading - // this will load data in to address 0 without notice. It is now marked as an error. machine.machine.set_register(A0, INDEX_OUT_OF_BOUND as u64); } continue; diff --git a/script/testdata/spawn_fuzzing b/script/testdata/spawn_fuzzing index fd7c2dffb2..0c1602e09a 100755 Binary files a/script/testdata/spawn_fuzzing and b/script/testdata/spawn_fuzzing differ diff --git a/script/testdata/spawn_fuzzing.c b/script/testdata/spawn_fuzzing.c index 280286eb0f..7702717c0a 100644 --- a/script/testdata/spawn_fuzzing.c +++ b/script/testdata/spawn_fuzzing.c @@ -24,6 +24,7 @@ int extract_command(Data* data, Command* cmd) { if (id > 250) { cmd->id = SyscallClose; cmd->fd_index = (size_t)(id % 2); + data->offset += 1; } else if (id > 128) { if ((data->offset + 7) > data->total_size) { return -1; @@ -31,6 +32,7 @@ int extract_command(Data* data, Command* cmd) { cmd->id = SyscallRead; memcpy(&cmd->buf_ptr, &data->ptr[data->offset + 1], 3); memcpy(&cmd->len_ptr, &data->ptr[data->offset + 4], 3); + data->offset += 7; } else { if ((data->offset + 7) > data->total_size) { return -1; @@ -38,6 +40,7 @@ int extract_command(Data* data, Command* cmd) { cmd->id = SyscallWrite; memcpy(&cmd->buf_ptr, &data->ptr[data->offset + 1], 3); memcpy(&cmd->len_ptr, &data->ptr[data->offset + 4], 3); + data->offset += 7; } return 0; }