@@ -321,6 +321,7 @@ hashMapResize(Thread* t, object map, uint32_t (*hash)(Thread*, object),
321
321
322
322
unsigned index = hash (t, k) & (newLength - 1 );
323
323
324
+ expect (t, p != arrayBody (t, newArray, index));
324
325
set (t, p, TripleThird, arrayBody (t, newArray, index));
325
326
set (t, newArray, ArrayBody + (index * BytesPerWord), p);
326
327
}
@@ -333,7 +334,7 @@ hashMapResize(Thread* t, object map, uint32_t (*hash)(Thread*, object),
333
334
334
335
void
335
336
hashMapInsert (Thread* t, object map, object key, object value,
336
- uint32_t (*hash)(Thread*, object))
337
+ uint32_t (*hash)(Thread*, object))
337
338
{
338
339
// note that we reinitialize the array and index variables whenever
339
340
// an allocation (and thus possibly a collection) occurs, in case
@@ -387,6 +388,7 @@ object
387
388
hashMapRemoveNode (Thread* t, object map, unsigned index, object p, object n)
388
389
{
389
390
if (p) {
391
+ expect (t, p != tripleThird (t, n));
390
392
set (t, p, TripleThird, tripleThird (t, n));
391
393
} else {
392
394
set (t, hashMapArray (t, map), ArrayBody + (index * BytesPerWord),
0 commit comments