diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c index 1419c053..77daba13 100644 --- a/libasn1fix/asn1fix_param.c +++ b/libasn1fix/asn1fix_param.c @@ -112,7 +112,7 @@ resolve_expr(asn1p_expr_t *expr_to_resolve, void *resolver_arg) { expr_to_resolve->reference); if(!expr) return NULL; } else if(expr_to_resolve->meta_type == AMT_VALUE) { - assert(expr_to_resolve->value); + if(!expr_to_resolve->value) return NULL; expr = find_target_specialization_bystr(rarg, expr_to_resolve->Identifier); if(!expr) return NULL; @@ -155,7 +155,7 @@ static asn1p_expr_t * find_target_specialization_byvalueset(resolver_arg_t *rarg, asn1p_constraint_t *ct) { asn1p_ref_t *ref; - assert(ct->type == ACT_EL_TYPE); + if (ct->type != ACT_EL_TYPE) return NULL; ref = ct->containedSubtype->value.v_type->reference; diff --git a/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P index e9af4b3b..89468a49 100644 --- a/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P +++ b/tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P @@ -24,7 +24,7 @@ typedef struct Frame { long ident; struct value { value_PR present; - union value_u { + union Frame__value_u { PrimitiveMessage_t PrimitiveMessage; ComplexMessage_t ComplexMessage; } choice; @@ -81,7 +81,7 @@ memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } static asn_type_selector_result_t -select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { +select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { asn_type_selector_result_t result = {0, 0}; const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1; size_t constraining_column = 0; /* &id */ @@ -188,7 +188,7 @@ static asn_TYPE_member_t asn_MBR_Frame_1[] = { .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_value_3, - .type_selector = select_value_type, + .type_selector = select_Frame_value_type, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 }, 0, 0, /* No default value */ .name = "value" diff --git a/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P index e9af4b3b..89468a49 100644 --- a/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P +++ b/tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P @@ -24,7 +24,7 @@ typedef struct Frame { long ident; struct value { value_PR present; - union value_u { + union Frame__value_u { PrimitiveMessage_t PrimitiveMessage; ComplexMessage_t ComplexMessage; } choice; @@ -81,7 +81,7 @@ memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } static asn_type_selector_result_t -select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { +select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { asn_type_selector_result_t result = {0, 0}; const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1; size_t constraining_column = 0; /* &id */ @@ -188,7 +188,7 @@ static asn_TYPE_member_t asn_MBR_Frame_1[] = { .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_value_3, - .type_selector = select_value_type, + .type_selector = select_Frame_value_type, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 }, 0, 0, /* No default value */ .name = "value" diff --git a/tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P b/tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P index 80abe317..9befb070 100644 --- a/tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P +++ b/tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P @@ -24,7 +24,7 @@ typedef struct Frame { ConstrainedInteger_t ident; struct value { value_PR present; - union value_u { + union Frame__value_u { PrimitiveMessage_t PrimitiveMessage; ComplexMessage_t ComplexMessage; } choice; @@ -87,7 +87,7 @@ memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } static asn_type_selector_result_t -select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { +select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { asn_type_selector_result_t result = {0, 0}; const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1; size_t constraining_column = 0; /* &id */ @@ -194,7 +194,7 @@ static asn_TYPE_member_t asn_MBR_Frame_1[] = { .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), .tag_mode = +1, /* EXPLICIT tag at current level */ .type = &asn_DEF_value_3, - .type_selector = select_value_type, + .type_selector = select_Frame_value_type, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 }, 0, 0, /* No default value */ .name = "value" diff --git a/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P b/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P index 2f0a421a..9020ba7f 100644 --- a/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P +++ b/tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P @@ -86,7 +86,7 @@ typedef struct SpecializedContent_30P0 { long id; struct value { value_PR present; - union value_u { + union SpecializedContent_30P0__value_u { long INTEGER; BOOLEAN_t BOOLEAN; } choice; @@ -141,7 +141,7 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } static asn_type_selector_result_t -select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { +select_SpecializedContent_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { asn_type_selector_result_t result = {0, 0}; const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1; size_t constraining_column = 0; /* &id */ @@ -248,7 +248,7 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = { .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_value_3, - .type_selector = select_value_type, + .type_selector = select_SpecializedContent_30P0_value_type, { .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 }, 0, 0, /* No default value */ .name = "value" diff --git a/tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER b/tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER index e17e676e..b232b5b3 100644 --- a/tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER +++ b/tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER @@ -86,7 +86,7 @@ typedef struct SpecializedContent_30P0 { long id; struct value { value_PR present; - union value_u { + union SpecializedContent_30P0__value_u { long INTEGER; BOOLEAN_t BOOLEAN; } choice; @@ -141,7 +141,7 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, } static asn_type_selector_result_t -select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { +select_SpecializedContent_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) { asn_type_selector_result_t result = {0, 0}; const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1; size_t constraining_column = 0; /* &id */ @@ -264,7 +264,7 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = { .tag = -1 /* Ambiguous tag (ANY?) */, .tag_mode = 0, .type = &asn_DEF_value_3, - .type_selector = select_value_type, + .type_selector = select_SpecializedContent_30P0_value_type, { .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 }, 0, 0, /* No default value */ .name = "value"