Bumps solana_rbpf to v0.2.16 (#21492)

This commit is contained in:
Alexander Meißner
2021-12-03 23:44:31 +01:00
committed by Trent Nelson
parent e52b3fd1d8
commit f04e06e0c2
10 changed files with 40 additions and 47 deletions

View File

@@ -7,9 +7,10 @@ use solana_bpf_loader_program::{
};
use solana_rbpf::{
assembler::assemble,
elf::Executable,
static_analysis::Analysis,
verifier::check,
vm::{Config, DynamicAnalysis, Executable},
vm::{Config, DynamicAnalysis},
};
use solana_sdk::{
account::AccountSharedData,
@@ -187,7 +188,7 @@ native machine code before execting it in the virtual machine.",
file.read_to_end(&mut contents).unwrap();
let syscall_registry = register_syscalls(&mut invoke_context).unwrap();
let mut executable = if magic == [0x7f, 0x45, 0x4c, 0x46] {
<dyn Executable<BpfError, ThisInstructionMeter>>::from_elf(
Executable::<BpfError, ThisInstructionMeter>::from_elf(
&contents,
None,
config,
@@ -209,7 +210,7 @@ native machine code before execting it in the virtual machine.",
check(text_bytes, &config).unwrap();
}
executable.jit_compile().unwrap();
let analysis = Analysis::from_executable(executable.as_ref());
let analysis = Analysis::from_executable(&executable);
match matches.value_of("use") {
Some("cfg") => {
@@ -226,7 +227,7 @@ native machine code before execting it in the virtual machine.",
}
let id = bpf_loader::id();
let mut vm = create_vm(&id, executable.as_ref(), &mut mem, &mut invoke_context).unwrap();
let mut vm = create_vm(&id, &executable, &mut mem, &mut invoke_context).unwrap();
let result = if matches.value_of("use").unwrap() == "interpreter" {
vm.execute_program_interpreted(&mut instruction_meter)
} else {
@@ -244,7 +245,7 @@ native machine code before execting it in the virtual machine.",
if matches.is_present("trace") {
println!("Trace is saved in trace.out");
let mut file = File::create("trace.out").unwrap();
let analysis = Analysis::from_executable(executable.as_ref());
let analysis = Analysis::from_executable(&executable);
vm.get_tracer().write(&mut file, &analysis).unwrap();
}
if matches.is_present("profile") {