diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-10-12 22:30:52 +0000 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2023-04-14 13:07:39 +0530 |
commit | 64f050178a9d99a0f79a97b09b36b29a5c8bf0e0 (patch) | |
tree | a86c1320309d8b0058e48ddd71ac054e29a5ad18 | |
parent | ecf80b17de34048998e734bd236947a0e10f6cef (diff) | |
download | haskell-64f050178a9d99a0f79a97b09b36b29a5c8bf0e0.tar.gz |
nonmoving: Don't push empty arrays to update remembered set
Previously the write barrier of resizeSmallArray# incorrectly handled
resizing of zero-sized arrays, pushing an invalid pointer to the update
remembered set.
Fixes #22931.
(cherry picked from commit 244640a067c0158db5f14f133212caa1a830030e)
-rw-r--r-- | rts/PrimOps.cmm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 53ed273904..f73b9edbf2 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -240,9 +240,9 @@ stg_shrinkSmallMutableArrayzh ( gcptr mba, W_ new_size ) p = mba + SIZEOF_StgSmallMutArrPtrs + WDS(new_size); end = mba + SIZEOF_StgSmallMutArrPtrs + WDS(StgSmallMutArrPtrs_ptrs(mba)); again: - ccall updateRemembSetPushClosure_(BaseReg "ptr", - W_[p] "ptr"); if (p < end) { + ccall updateRemembSetPushClosure_(BaseReg "ptr", + W_[p] "ptr"); p = p + SIZEOF_W; goto again; } |