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

add check for invalid state in _growend! slow-path #53513

Merged
merged 6 commits into from
Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix condition
  • Loading branch information
oscardssmith committed Mar 4, 2024
commit 5b812b89da89a2bf08b50fd2a5e2dd62ad40ce70
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ function _growend!(a::Vector, delta::Integer)
newmemlen = offset + newlen - 1
if memlen < newmemlen
@noinline (function()
if offset + len <= memlen || offset < 1
if offset + len - 1 > memlen || offset < 1
throw(ConcurrencyViolationError("Vector has invalid state. Don't modify internal fields incorrectly, or resize without correct locks"))
end

Expand Down