Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Fixes the build of the CLI tool. (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso authored Nov 13, 2021
1 parent 7ceff45 commit aa79a37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use clap::{App, Arg};
use solana_rbpf::{
assembler::assemble,
ebpf,
memory_region::{MemoryMapping, MemoryRegion},
memory_region::MemoryMapping,
static_analysis::Analysis,
syscalls::Result,
user_error::UserError,
verifier::check,
vm::{Config, DynamicAnalysis, EbpfVm, Executable, SyscallObject, SyscallRegistry, TestInstructionMeter},
vm::{
Config, DynamicAnalysis, EbpfVm, Executable, SyscallObject, SyscallRegistry,
TestInstructionMeter,
},
};
use std::{fs::File, io::Read, path::Path};

Expand Down Expand Up @@ -185,16 +187,15 @@ fn main() {
.parse::<u64>()
.unwrap(),
};
let heap = vec![
let mut heap = vec![
0_u8;
matches
.value_of("memory")
.unwrap()
.parse::<usize>()
.unwrap()
];
let heap_region = MemoryRegion::new_from_slice(&heap, ebpf::MM_HEAP_START, 0, true);
let mut vm = EbpfVm::new(executable.as_ref(), &mut mem, &[heap_region]).unwrap();
let mut vm = EbpfVm::new(executable.as_ref(), &mut mem, &mut heap).unwrap();
for (hash, name) in analysis.executable.get_syscall_symbols() {
vm.bind_syscall_context_object(Box::new(MockSyscall { name: name.clone() }), Some(*hash))
.unwrap();
Expand Down

0 comments on commit aa79a37

Please sign in to comment.