Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bincode deserialization with serde might be broken #74

Closed
iqualfragile opened this issue May 12, 2016 · 5 comments
Closed

bincode deserialization with serde might be broken #74

iqualfragile opened this issue May 12, 2016 · 5 comments

Comments

@iqualfragile
Copy link

@iqualfragile iqualfragile commented May 12, 2016

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented May 12, 2016

This is really unexpected.

Serde probably shouldn't be doing a dynamic visit for this code?

Here's an even smaller repro.

input

#![feature(custom_derive, plugin)]
#![plugin(serde_macros)]
extern crate bincode;

use bincode::SizeLimit;
use bincode::serde::{serialize, deserialize};

fn main() {
    let input = [0u8; 5];
    println!("{:?}", input);
    let serialized = serialize(&input, SizeLimit::Infinite).unwrap();
    println!("{:?}", serialized);
    let deserialized: [u8; 5]= deserialize(&serialized).unwrap();
    println!("{:?}", deserialized);
}

@erickt, do you know what's going on here? Could you point me to the implementation of serialization and deserialization for arrays?

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented May 12, 2016

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented May 12, 2016

Oh, it's because we don't have deserialize_fixed_size_array implemented.

@iqualfragile
Copy link
Author

@iqualfragile iqualfragile commented May 13, 2016

Ok, is there something i can do to help fix this?

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented May 14, 2016

I'm a bit strapped for time right now, but if you wanted to look at implementing deserialize_fixed_size_array on the Deserializer struct, then everything should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.