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

Messaging: check the class of the list wrapped by ListSlice_ #2310

Merged
merged 5 commits into from
May 17, 2024

Conversation

erikcorry
Copy link
Member

ListSlice_ can wrap anything that implements List, not just List_. So we can't assume it's a List_.

ListSlice_ can wrap anything that implements List, not just
List_.  So we can't assume it's a List_.
@erikcorry erikcorry requested a review from kasperl May 16, 2024 07:57
@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.

Maybe add a regression test?

src/messaging.cc Outdated
Comment on lines 189 to 192
Smi* perhaps_list_class_id = list->class_id();
if (perhaps_list_class_id != program->list_class_id()) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

I'd move this up to right after you fetch the list from the slice (line 182).

Suggested change
Smi* perhaps_list_class_id = list->class_id();
if (perhaps_list_class_id != program->list_class_id()) {
return false;
}
// We currently do not support serializing slices of non-default lists.
if (list->class_id() != program->list_class_id()) return false;

@kasperl kasperl merged commit a153070 into master May 17, 2024
24 of 25 checks passed
@kasperl kasperl deleted the messaging-list-slice branch May 17, 2024 06:23
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