#4271 not reproducable, remove workaround (#4363)

This commit is contained in:
Jack May 2019-05-20 23:45:09 -07:00 committed by GitHub
parent 1a77486f8e
commit ef0580bd3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 7 deletions

16
Cargo.lock generated
View File

@ -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"

View File

@ -181,8 +181,7 @@ pub fn deserialize<'a>(
let mut ka: [Option<SolKeyedAccount>; 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::<u64>();
// 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]),