From 5f4d86a7034028078f8728478363656aaf5a34ef Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 11 Aug 2008 15:20:12 -0600 Subject: [PATCH] avoid potential corruption in hashMapInsert due to table-resize-on-GC --- src/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index f1a47206c1..d529636a32 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -380,11 +380,12 @@ hashMapInsert(Thread* t, object map, object key, object value, unsigned index = h & (arrayLength(t, array) - 1); - object n = makeTriple(t, k, value, arrayBody(t, array, index)); + object n = makeTriple(t, k, value, 0); array = hashMapArray(t, map); index = h & (arrayLength(t, array) - 1); + set(t, n, TripleThird, arrayBody(t, array, index)); set(t, array, ArrayBody + (index * BytesPerWord), n); }