valence-rs/valence

Panic on loading an anvil world

tsatke opened this issue · 0 comments

tsatke commented

Valence Version

623392b

What You Did

Ran the anvil_loading example with a newly generated 1.20.1 world and with a few downloaded worlds, always panicked with

thread '<unnamed>' panicked at 'range 0..2 out of bounds: 0', /Users/tsatke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitvec-1.0.1/src/slice/api.rs:2681:1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Additional Information

        let mut used_sectors = bitvec::vec::BitVec::new();
        used_sectors[0..2].fill(true);

I found this in the anvil crate, and maybe I don't understand it exactly, but I don't understand how this could work. Wouldn't this always lead to an oob? This is the line where the panic occurs btw.

The commit that added that piece of code was 78a12d4 .