summaryrefslogtreecommitdiff
path: root/weakmap.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-03-14 23:18:11 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-03-14 23:18:11 -0400
commit3dc8cde70078ccb38f5f4b0818ad5eecded01bd5 (patch)
treec75cefa316ff3a2af04bea8f7a16fa0d1ee1bc53 /weakmap.c
parent70ba3102129dbaf6c943d1ed042103e0238842f4 (diff)
downloadruby-3dc8cde70078ccb38f5f4b0818ad5eecded01bd5.tar.gz
Fix crash during compaction
[Bug #19529] The fix for [Bug #19529] in commit 548086b contained a bug that crashes on the following script: ``` wm = ObjectSpace::WeakMap.new obj = Object.new 100.times do wm[Object.new] = obj GC.start end GC.compact ```
Diffstat (limited to 'weakmap.c')
-rw-r--r--weakmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/weakmap.c b/weakmap.c
index 2145e4d2f8..1e86f22988 100644
--- a/weakmap.c
+++ b/weakmap.c
@@ -17,7 +17,7 @@ wmap_replace_ref(st_data_t *key, st_data_t *value, st_data_t _argp, int existing
{
*key = rb_gc_location((VALUE)*key);
- VALUE *values = (VALUE *)value;
+ VALUE *values = (VALUE *)*value;
VALUE size = values[0];
for (VALUE index = 1; index <= size; index++) {