diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-10-12 22:30:52 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-03-08 15:02:30 -0500 |
commit | c4e6bfc801a79b73e94d363db1d3e65076e17981 (patch) | |
tree | 89f0956478a65c792493cf88a8a5c63c636bd0f4 | |
parent | bd9cd84bbbb51f21c7b2b478e1f5971e2659b9fd (diff) | |
download | haskell-c4e6bfc801a79b73e94d363db1d3e65076e17981.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.
-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 adb48c97d9..60d0dc2ccc 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -297,9 +297,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; } |