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