Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/auto/defs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function _populate_registry!()
(Core, :memoryrefnew, (2,), (), ()),
(Core, :memoryref, (2,), (), ()),
(Core, :memoryrefoffset, (2,), (), ()),
(Core, :memoryrefget, (), (), ()),
(Core, :memoryrefget, (2,), (), ()),
(Core, :memoryrefset!, (), (2,), (3,)),
(Core, :memoryrefswap!, (), (2,), (3,)),
(Core, :memoryrefmodify!, (), (2,), (4,)),
Expand Down
11 changes: 11 additions & 0 deletions test/auto_borrow_checker_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@
@test_throws BorrowCheckError _bc_bang_mutates_second_bad()
end

@testset "array element extraction preserves aliases" begin
@safe function _bc_array_getindex_alias_bad(outer::Vector{Vector{Int}})
a = outer[1]
b = outer[1]
push!(a, 2)
return b
end

@test_throws BorrowCheckError _bc_array_getindex_alias_bad([[1]])
end

@testset "adversarial overloads (no special-casing overloadables)" begin
mutable struct _BCGetPropMutates
x::Vector{Int}
Expand Down
Loading