-
Notifications
You must be signed in to change notification settings - Fork 86
Copilot/fix 276 #278
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
base: vlm_master
Are you sure you want to change the base?
Copilot/fix 276 #278
Conversation
- Fixed IOC code generation for anonymous SEQUENCE OF/SET OF types - Added proper type name resolution for element types in IOC context - Added forward declarations for anonymous type descriptors - Anonymous SEQUENCE OF types now generate proper asn_DEF_X_Y_Z references - Resolves compilation errors when using SEQUENCE OF in Information Object Classes Co-authored-by: mouse07410 <5923577+mouse07410@users.noreply.github.com>
|
@copilot Fix these problems and update PR: |
|
@copilot requested correction to prevent confusion between type names and include file names has not been applied. Apply it and update this PR |
|
@copilot remedy this problem is parametrized type code generation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes compilation issues when handling C2X ASN.1 files containing parametrized objects, specifically addressing problems with anonymous SEQUENCE OF and SET OF types in Information Object Class (IOC) contexts.
- Adds special handling for anonymous SEQUENCE OF and SET OF types within IOC cells
- Generates proper type descriptor names for anonymous collection types using element type and unique index
- Introduces forward declarations for anonymous types to prevent compilation errors
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const char *type_name = asn1c_type_name(arg, cell->value, TNF_SAFE); | ||
| if(strcmp(type_name, "SEQUENCE_OF") == 0 || strcmp(type_name, "SET_OF") == 0) { | ||
| const char *constructor = (cell->value->expr_type == ASN_CONSTR_SEQUENCE_OF) | ||
| ? "SEQUENCE_OF" : "SET_OF"; |
Copilot
AI
Sep 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block duplicates the logic from lines 240-247. Consider extracting this into a helper function to avoid code duplication and improve maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot do the refactoring
|
@copilot fix the CI errors and update this PR |
mouse07410
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply requested changes to this PR
The logic for determining constructor type is duplicated. The constructor determination should rely on the same condition used in line 241, or use cell->value->expr_type consistently throughout instead of string comparison. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix compilation of C2X ASN.1 file with parametrized objects