-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,8 +232,34 @@ emit_ioc_cell(arg_t *arg, struct asn1p_ioc_cell_s *cell) { | |
| GEN_INCLUDE(asn1c_type_name(arg, cell->value, TNF_INCLUDE)); | ||
| OUT("aioc__type, &asn_DEF_%s", MKID(cell->value)); | ||
| } else if(cell->value->meta_type == AMT_TYPE) { | ||
| GEN_INCLUDE(asn1c_type_name(arg, cell->value, TNF_INCLUDE)); | ||
| OUT("aioc__type, &asn_DEF_%s", asn1c_type_name(arg, cell->value, TNF_SAFE)); | ||
| /* | ||
| * Handle anonymous SEQUENCE OF and SET OF types in IOC context. | ||
| * These need special handling because they don't have their own | ||
| * identifiers but need proper type descriptors. | ||
| */ | ||
| 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) { | ||
| /* | ||
| * For anonymous SEQUENCE OF/SET OF types in IOC context, | ||
| * generate the proper type descriptor name based on the element type. | ||
| */ | ||
mouse07410 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const char *constructor = (cell->value->expr_type == ASN_CONSTR_SEQUENCE_OF) | ||
| ? "SEQUENCE_OF" : "SET_OF"; | ||
mouse07410 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| asn1p_expr_t *element = TQ_FIRST(&(cell->value->members)); | ||
| const char *element_name = "Member"; | ||
|
|
||
| if(element && element->expr_type == A1TC_REFERENCE && element->reference) { | ||
| /* Get the referenced type name */ | ||
| element_name = element->reference->components[ | ||
| element->reference->comp_count - 1].name; | ||
| } | ||
|
|
||
| GEN_INCLUDE(asn1c_type_name(arg, cell->value, TNF_INCLUDE)); | ||
| OUT("aioc__type, &asn_DEF_%s_%s_%d", constructor, element_name, cell->value->_type_unique_index); | ||
| } else { | ||
| GEN_INCLUDE(asn1c_type_name(arg, cell->value, TNF_INCLUDE)); | ||
| OUT("aioc__type, &asn_DEF_%s", type_name); | ||
| } | ||
| } else { | ||
| return -1; | ||
| } | ||
|
|
@@ -270,6 +296,32 @@ emit_ioc_table(arg_t *arg, asn1p_expr_t *context, asn1c_ioc_table_and_objset_t i | |
| } | ||
| } | ||
|
|
||
| /* Generate forward declarations for anonymous SEQUENCE OF/SET OF types */ | ||
| for(size_t rn = 0; rn < ioc_tao.ioct->rows; rn++) { | ||
| asn1p_ioc_row_t *row = ioc_tao.ioct->row[rn]; | ||
| for(size_t cn = 0; cn < row->columns; cn++) { | ||
| struct asn1p_ioc_cell_s *cell = &row->column[cn]; | ||
| if(cell->value && cell->value->meta_type == AMT_TYPE) { | ||
| 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"; | ||
|
Comment on lines
+305
to
+308
|
||
| asn1p_expr_t *element = TQ_FIRST(&(cell->value->members)); | ||
| const char *element_name = "Member"; | ||
|
|
||
| if(element && element->expr_type == A1TC_REFERENCE && element->reference) { | ||
| /* Get the referenced type name */ | ||
| element_name = element->reference->components[ | ||
| element->reference->comp_count - 1].name; | ||
| } | ||
|
|
||
| OUT("static asn_TYPE_descriptor_t asn_DEF_%s_%s_%d;\n", | ||
| constructor, element_name, cell->value->_type_unique_index); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if(ioc_tao.ioct->rows == 0) | ||
| return 0; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.