From ef0580bd3dff7803de8d139ff46ffa5647189177 Mon Sep 17 00:00:00 2001 From: Jack May Date: Mon, 20 May 2019 23:45:09 -0700 Subject: [PATCH] #4271 not reproducable, remove workaround (#4363) --- Cargo.lock | 16 +++++++++++++++- sdk/bpf/rust-utils/src/lib.rs | 7 +------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35be81172..f9dff16b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2304,7 +2304,7 @@ dependencies = [ "serde 1.0.91 (registry+https://github.com/rust-lang/crates.io-index)", "solana-logger 0.15.0", "solana-sdk 0.15.0", - "solana_rbpf 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "solana_rbpf 0.1.11", ] [[package]] @@ -2809,6 +2809,20 @@ dependencies = [ "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "solana_rbpf" +version = "0.1.11" +dependencies = [ + "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "combine 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "elfkit 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "hash32 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "solana_rbpf" version = "0.1.11" diff --git a/sdk/bpf/rust-utils/src/lib.rs b/sdk/bpf/rust-utils/src/lib.rs index 2604d3ccc..2f8524b0d 100644 --- a/sdk/bpf/rust-utils/src/lib.rs +++ b/sdk/bpf/rust-utils/src/lib.rs @@ -181,8 +181,7 @@ pub fn deserialize<'a>( let mut ka: [Option; MAX_ACCOUNTS] = [None, None, None, None, None, None, None, None, None, None]; - let iter = 0..num_ka; // This weirdness due to #issue $#4271 - for (i, _) in iter.enumerate() { + for i in 0..num_ka { let is_signer = unsafe { #[allow(clippy::cast_ptr_alignment)] let is_signer_ptr: *const u64 = input.add(offset) as *const u64; @@ -194,10 +193,6 @@ pub fn deserialize<'a>( }; offset += size_of::(); - // let key_slice = unsafe { from_raw_parts(input.add(offset), SIZE_PUBKEY) }; - // let key = SolPubkey { - // key: key_slice.try_into().unwrap(), - // }; let key = unsafe { SolPubkey { key: &*(input.add(offset) as *mut [u8; SIZE_PUBKEY]),