Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing write barrier in array-replace #2309

Merged
merged 4 commits into from
May 17, 2024
Merged

Add missing write barrier in array-replace #2309

merged 4 commits into from
May 17, 2024

Conversation

erikcorry
Copy link
Member

No description provided.

@erikcorry erikcorry requested a review from kasperl May 16, 2024 07:46
@cla-bot cla-bot bot added the cla-signed The contributors have signed the CLA label May 16, 2024
Copy link
Member

@kasperl kasperl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Can you provoke the issue (before fixing it) with a regression test?

@@ -1708,6 +1708,7 @@ PRIMITIVE(array_replace) {
if (index < 0 || from < 0 || from > to || to > source_length) FAIL(OUT_OF_BOUNDS);
word len = to - from;
if (index + len > dest_length) FAIL(OUT_OF_BOUNDS);
if (dest != source) GcMetadata::insert_into_remembered_set(dest);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment to explain why you can avoid the write barrier if dest == source.

Also, fix the comment in line 1703: betwen -> between.

@kasperl kasperl merged commit 62da783 into master May 17, 2024
7 of 25 checks passed
@kasperl kasperl deleted the gc-array-replace branch May 17, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The contributors have signed the CLA
Development

Successfully merging this pull request may close these issues.

None yet

2 participants