Skip to content

Commit

Permalink
Merge pull request #17385 from JuliaLang/yyc/gc/array-wb
Browse files Browse the repository at this point in the history
Fix array copy write barrier check
  • Loading branch information
yuyichao authored Jul 12, 2016
2 parents 38c803d + c13c6d9 commit f881efb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,9 @@ JL_DLLEXPORT void jl_array_ptr_copy(jl_array_t *dest, void **dest_p,
// Destination is old and doesn't refer to any young object
if (__unlikely(jl_astaggedvalue(owner)->bits.gc == GC_OLD_MARKED)) {
jl_value_t *src_owner = jl_array_owner(src);
// Source is young or might refer to young objects
if (!(jl_astaggedvalue(src_owner)->bits.gc & GC_OLD)) {
// Source is young or being promoted or might refer to young objects
// (i.e. source is not an old object that doesn't have wb triggered)
if (jl_astaggedvalue(src_owner)->bits.gc != GC_OLD_MARKED) {
ssize_t done;
if (dest_p < src_p || dest_p > src_p + n) {
done = jl_array_ptr_copy_forward(owner, src_p, dest_p, n);
Expand Down

0 comments on commit f881efb

Please sign in to comment.