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

[UUM-78961] Fixed initialization of a class which has last fields in a table with 65535 field entries and the next class having no fields #2081

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mono/metadata/class-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,9 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError

if (tt->rows > tidx){
mono_metadata_decode_row (tt, tidx, cols_next, MONO_TYPEDEF_SIZE);
alexey-zakharov marked this conversation as resolved.
Show resolved Hide resolved
field_last = cols_next [MONO_TYPEDEF_FIELD_LIST] - 1;
method_last = cols_next [MONO_TYPEDEF_METHOD_LIST] - 1;
// check if the next row has fields at all, if not, then continue run till the end of the table
field_last = cols_next [MONO_TYPEDEF_FIELD_LIST] ? cols_next [MONO_TYPEDEF_FIELD_LIST] - 1 : image->tables [MONO_TABLE_FIELD].rows;
method_last = cols_next [MONO_TYPEDEF_METHOD_LIST] ? cols_next [MONO_TYPEDEF_METHOD_LIST] - 1 : image->tables [MONO_TABLE_METHOD].rows;
} else {
field_last = image->tables [MONO_TABLE_FIELD].rows;
method_last = image->tables [MONO_TABLE_METHOD].rows;
Expand Down