diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2022-10-12 22:30:52 +0000 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2023-04-12 07:43:22 -0400 |
| commit | 5a5257056c648983fca80ad6a1e5e8f7e7ac457c (patch) | |
| tree | ea404e7cbce9e8c6abc1693bf0a27c21ce65e5ef | |
| parent | a38f0a816ab163e599d227b44afcda6c41324cc1 (diff) | |
| download | haskell-5a5257056c648983fca80ad6a1e5e8f7e7ac457c.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; } |
