Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelang committed Mar 13, 2019
1 parent 016647c commit 2770761
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions bindings/rust/evmc-vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,14 @@ impl EvmcResult {
status: ffi::evmc_status_code,
gasleft: i64,
output: &[u8],
create_addr: Option<ffi::evmc_address>,
) -> Self {
EvmcResult(Box::new(ffi::evmc_result {
status_code: status,
gas_left: i64,
gas_left: gasleft,
output_data: output.as_ptr(),
output_size: output.len(),
release: release_result,
create_address: if let Some(addr) = create_addr {
addr
} else {
evmc_address { bytes: [0u8; 20] }
},
release: Some(release_result),
create_address: ffi::evmc_address { bytes: [0u8; 20] },
padding: [0u8; 4],
}))
}
Expand All @@ -37,6 +32,6 @@ impl EvmcResult {
#[no_mangle]
pub extern "C" fn release_result(result: *const ffi::evmc_result) {
unsafe {
Box::from_raw(result);
Box::from_raw(result as *mut ffi::evmc_result);
}
}

0 comments on commit 2770761

Please sign in to comment.