summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2022-10-27 18:03:10 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-22 23:36:10 -0500
commit914f7fe3756734714a6795fc4bbca96442b01f92 (patch)
tree30a5e7d49931a01b0b92f3c87f746db3ccae2ca4 /rts/PrimOps.cmm
parentfc3a2232da89ed4442b52a99ba1826d04362a7e8 (diff)
downloadhaskell-914f7fe3756734714a6795fc4bbca96442b01f92.tar.gz
Don't consider large byte arrays/compact regions pinned.
Workaround for #22255 which showed how treating large/compact regions as pinned could cause segfaults.
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 0868fdaa9e..adb48c97d9 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -209,7 +209,10 @@ stg_isByteArrayPinnedzh ( gcptr ba )
// See the comment in Storage.c:allocatePinned.
// We also consider BF_COMPACT objects to be immovable. See #14900.
flags = TO_W_(bdescr_flags(bd));
- return (flags & (BF_PINNED | BF_LARGE | BF_COMPACT) != 0);
+
+ // We used to also consider BF_LARGE pinned, but stopped doing so
+ // because it interacted badly with compact regions. See #22255
+ return (flags & BF_PINNED != 0);
}
stg_isMutableByteArrayPinnedzh ( gcptr mba )