avoid potential corruption in hashMapInsert due to table-resize-on-GC

This commit is contained in:
Joel Dice 2008-08-11 15:20:12 -06:00
parent 22a5707966
commit 5f4d86a703

View File

@ -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);
}