-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]breakingThis change will break codeThis change will break codeminor changeMarginal behavior change acceptable for a minor releaseMarginal behavior change acceptable for a minor releasespeculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative
Description
julia> function foo()
A=[([],), ([],)];
x=unsafe_load(pointer(A));
A[2]=x;
p1 = unsafe_load(reinterpret(Ptr{UInt64},pointer(A)), 1)
p2 = unsafe_load(reinterpret(Ptr{UInt64},pointer(A)), 2)
p3 = unsafe_load(reinterpret(Ptr{UInt64},p2))
@show p1,p2,p3
return A
end
julia> r=foo();
(p1, p2, p3) = (0x00007f2f0543f8d0, 0x00007f2f05638110, 0x00007f2f0543f8d0)
julia> r
2-element Array{Tuple{Array{Any,1}},1}:
signal (11): Segmentation fault
I am not entirely sure whether this is supposed to be working. If not, then maybe unsafe_load could error out earlier.
If this is supposed to be working, we see that someone got confused about types / numbers of indirection: A[2] points to something that points to A[1], instead of pointing to something that points to A[1][1] (like e.g. A[1]). Also reproduces in the REPL (ie without compilation). Tested on 1.0.2.
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]breakingThis change will break codeThis change will break codeminor changeMarginal behavior change acceptable for a minor releaseMarginal behavior change acceptable for a minor releasespeculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative