Skip to content

Commit 9c82bd2

Browse files
author
Joel Dice
committed
Merge branch 'master' of oss.readytalk.com:/var/local/git/avian
2 parents fcd4f0c + 149949a commit 9c82bd2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ hashMapResize(Thread* t, object map, uint32_t (*hash)(Thread*, object),
320320

321321
unsigned index = hash(t, k) & (newLength - 1);
322322

323+
expect(t, p != arrayBody(t, newArray, index));
323324
set(t, p, TripleThird, arrayBody(t, newArray, index));
324325
set(t, newArray, ArrayBody + (index * BytesPerWord), p);
325326
}
@@ -332,7 +333,7 @@ hashMapResize(Thread* t, object map, uint32_t (*hash)(Thread*, object),
332333

333334
void
334335
hashMapInsert(Thread* t, object map, object key, object value,
335-
uint32_t (*hash)(Thread*, object))
336+
uint32_t (*hash)(Thread*, object))
336337
{
337338
// note that we reinitialize the array and index variables whenever
338339
// an allocation (and thus possibly a collection) occurs, in case
@@ -386,6 +387,7 @@ object
386387
hashMapRemoveNode(Thread* t, object map, unsigned index, object p, object n)
387388
{
388389
if (p) {
390+
expect(t, p != tripleThird(t, n));
389391
set(t, p, TripleThird, tripleThird(t, n));
390392
} else {
391393
set(t, hashMapArray(t, map), ArrayBody + (index * BytesPerWord),

0 commit comments

Comments
 (0)