mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
avoid potential corruption in hashMapInsert due to table-resize-on-GC
This commit is contained in:
parent
22a5707966
commit
5f4d86a703
@ -380,11 +380,12 @@ hashMapInsert(Thread* t, object map, object key, object value,
|
|||||||
|
|
||||||
unsigned index = h & (arrayLength(t, array) - 1);
|
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);
|
array = hashMapArray(t, map);
|
||||||
index = h & (arrayLength(t, array) - 1);
|
index = h & (arrayLength(t, array) - 1);
|
||||||
|
|
||||||
|
set(t, n, TripleThird, arrayBody(t, array, index));
|
||||||
set(t, array, ArrayBody + (index * BytesPerWord), n);
|
set(t, array, ArrayBody + (index * BytesPerWord), n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user