summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-07-03 19:09:03 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-03 19:42:21 -0400
commita6f3d1b00e9c37a56cd4db9e519309e94a65d181 (patch)
treeb2133ecde8fef1e90649a667b20946fde4a62d8a /rts/PrimOps.cmm
parentef63ff27251a20ff11e58c9303677fa31e609a88 (diff)
downloadhaskell-a6f3d1b00e9c37a56cd4db9e519309e94a65d181.tar.gz
rts: Fix isByteArrayPinned#'s treatment of large arrays
It should respond with True to both BF_PINNED and BF_LARGE byte arrays. However, previously it would only check the BF_PINNED flag. Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: winterland1989, rwbarton, thomie GHC Trac Issues: #13894 Differential Revision: https://phabricator.haskell.org/D3685
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index dddba396c3..006c9de8c8 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -147,10 +147,11 @@ stg_isByteArrayPinnedzh ( gcptr ba )
{
W_ bd, flags;
bd = Bdescr(ba);
- // pinned byte arrays live in blocks with the BF_PINNED flag set.
+ // Pinned byte arrays live in blocks with the BF_PINNED flag set.
+ // We also consider BF_LARGE objects to be unmoveable. See #13894.
// See the comment in Storage.c:allocatePinned.
flags = TO_W_(bdescr_flags(bd));
- return (flags & BF_PINNED != 0);
+ return (flags & (BF_PINNED | BF_LARGE) != 0);
}
stg_isMutableByteArrayPinnedzh ( gcptr mba )