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

Issue about calculating secondary data type size. #11

Open
zzdmfk opened this issue Oct 14, 2023 · 3 comments
Open

Issue about calculating secondary data type size. #11

zzdmfk opened this issue Oct 14, 2023 · 3 comments

Comments

@zzdmfk
Copy link

zzdmfk commented Oct 14, 2023

When I declared variables like below:

short int a;
long int b;

Data type sizes were calculated wrong In function:

void parser_datatype_adjust_size_for_secondary(struct datatype* datatype, struct token* datatype_secondary_token)
{
    if(!datatype_secondary_token)
        return;

    struct datatype* secondary_data_type = calloc(1, sizeof(struct datatype));
    parser_datatype_init_type_and_size_for_primitive(datatype_secondary_token, NULL, secondary_data_type);
    datatype->size += secondary_data_type->size;
    datatype->datatype_secondary = secondary_data_type;
    datatype->flags |= DATATYPE_FLAG_IS_SECONDARY;
}

short int a; //datatype->size=6
long int b; //datatype->size=8

@nibblebits
Copy link
Owner

Yes the secondary datatype has been miscalculated thats for bringing this to my attention it will be resolved

@nibblebits
Copy link
Owner

Thanks *

@nibblebits
Copy link
Owner

Hello,
Thanks for reaching out, once theres enough issue reports I will go through them all and create a lecture addressing any issues.

Thanks
Dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants