We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Similar to #611, but with three elements instead of two. This one wasn't fixed in #612.
running julia --check-bounds=yes and then
julia --check-bounds=yes
julia> using DataStructures julia> x = MutableBinaryMinHeap{Int}() MutableBinaryHeap() julia> h1 = push!(x,1) 1 julia> h2 = push!(x,2) 2 julia> h3 = push!(x,3) 3 julia> delete!(x, h3) ERROR: BoundsError: attempt to access 2-element Array{DataStructures.MutableBinaryHeapNode{Int64},1} at index [3] Stacktrace: [1] getindex at .\array.jl:809 [inlined] [2] _heap_bubble_down!(::Base.Order.ForwardOrdering, ::Array{DataStructures.MutableBinaryHeapNode{Int64},1}, ::Array{Int64,1}, ::Int64) at C:\Users\Johannes\.julia\packages\DataStructures\CINja\src\heaps\mutable_binary_heap.jl:46 [3] _binary_heap_pop!(::Base.Order.ForwardOrdering, ::Array{DataStructures.MutableBinaryHeapNode{Int64},1}, ::Array{Int64,1}, ::Int64) at C:\Users\Johannes\.julia\packages\DataStructures\CINja\src\heaps\mutable_binary_heap.jl:124 [4] delete!(::MutableBinaryHeap{Int64,Base.Order.ForwardOrdering}, ::Int64) at C:\Users\Johannes\.julia\packages\DataStructures\CINja\src\heaps\mutable_binary_heap.jl:273 [5] top-level scope at REPL[17]:1
Im on [864edb3b] DataStructures v0.18.5. Same bug also appeared on [864edb3b] DataStructures v0.17.14, so it's not a regression.
[864edb3b] DataStructures v0.18.5
[864edb3b] DataStructures v0.17.14
Running the same code without --check-bounds=yes works as expected:
--check-bounds=yes
julia> using DataStructures julia> x = MutableBinaryMinHeap{Int}() MutableBinaryHeap() julia> h1 = push!(x,1) 1 julia> h2 = push!(x,2) 2 julia> h3 = push!(x,3)# 3 julia> x MutableBinaryHeap(1, 2, 3) julia> delete!(x, h3) MutableBinaryHeap(1, 2)
Stumbled over it while writing a test, so tests seem to be run with bounds check. Why wouldn't this show up in the tests for DataStructures.jl?
Don't know how to fix it yet, haven't had time to look at the offending code.
The text was updated successfully, but these errors were encountered:
40d54aa
Merge pull request #680 from Firionus/fix-#678
355a7a8
Fix #678 BoundsError in MutableBinaryHeap delete! with 3 elements
No branches or pull requests
Similar to #611, but with three elements instead of two. This one wasn't fixed in #612.
Example
running
julia --check-bounds=yes
and thenIm on
[864edb3b] DataStructures v0.18.5
. Same bug also appeared on[864edb3b] DataStructures v0.17.14
, so it's not a regression.Running the same code without
--check-bounds=yes
works as expected:Note
Stumbled over it while writing a test, so tests seem to be run with bounds check. Why wouldn't this show up in the tests for DataStructures.jl?
Don't know how to fix it yet, haven't had time to look at the offending code.
The text was updated successfully, but these errors were encountered: