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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 fix bus error on smaller readonly file in unix #44354

Merged
merged 10 commits into from
Aug 21, 2023
Prev Previous commit
Next Next commit
Apply suggestions from code review
  • Loading branch information
vtjnash committed Jul 18, 2023
commit b7829c9fe0d5b24e1891d93eb9141243983aaaf7
6 changes: 2 additions & 4 deletions stdlib/Mmap/src/Mmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ function mmap(io::IO,
else
throw(ArgumentError("requested size $szfile larger than file size $(filesize(io)), but requested not to grow"))
end
end
if !iswrite
else
throw(ArgumentError("unable to increase file size to $szfile due to read-only permissions"))
end
end
Expand All @@ -234,8 +233,7 @@ function mmap(io::IO,
if requestedSizeLarger
if readonly
throw(ArgumentError("unable to increase file size to $szfile due to read-only permissions"))
end
if !readonly && !grow
elseif !grow
throw(ArgumentError("requested size $szfile larger than file size $(filesize(io)), but requested not to grow"))
end
end
Expand Down