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

Index out of bounds on Vector::iter() #70

Closed
krobelus opened this issue Mar 2, 2019 · 0 comments
Closed

Index out of bounds on Vector::iter() #70

krobelus opened this issue Mar 2, 2019 · 0 comments

Comments

@krobelus
Copy link
Contributor

krobelus commented Mar 2, 2019

Below is a program that causes a crash.
The problem seems to have been introduced in 6d0b068.

fn main() {
    let mut x = im::Vector::new();
    for _ in 0..262 {
        x.push_back(0);
    }
    for _ in 0..97 {
        x.pop_front();
    }
    for &offset in &[160, 163, 160] {
        x.remove(offset);
    }
    for _ in 0..5 {
        x.pop_front();
    }
    for _ in 0..128 {
        x.push_back(0);
    }
    x.push_back(0);
    for _ in x.iter() {
    }
}
krobelus added a commit to krobelus/im-rs that referenced this issue Mar 3, 2019
If push_chunk is given a chunk that is small enough to fit in the current last
chunk, just put the data in there and do not add another chunk. This keeps the
node dense.

Closes bodil#70
krobelus added a commit to krobelus/im-rs that referenced this issue Mar 3, 2019
If push_chunk is given a chunk that is small enough to fit in the current last
chunk, just put the data in there and do not add another chunk. This keeps the
node dense.

Closes bodil#70
@bodil bodil closed this as completed in #71 Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant