Skip to content

Commit e460c3b

Browse files
brchiuvlm
authored andcommitted
Fix error during 'make check'
1 parent 156b0fe commit e460c3b

6 files changed

+17
-17
lines changed

libasn1fix/asn1fix_param.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ resolve_expr(asn1p_expr_t *expr_to_resolve, void *resolver_arg) {
112112
expr_to_resolve->reference);
113113
if(!expr) return NULL;
114114
} else if(expr_to_resolve->meta_type == AMT_VALUE) {
115-
assert(expr_to_resolve->value);
115+
if(!expr_to_resolve->value) return NULL;
116116
expr = find_target_specialization_bystr(rarg,
117117
expr_to_resolve->Identifier);
118118
if(!expr) return NULL;
@@ -155,7 +155,7 @@ static asn1p_expr_t *
155155
find_target_specialization_byvalueset(resolver_arg_t *rarg, asn1p_constraint_t *ct) {
156156
asn1p_ref_t *ref;
157157

158-
assert(ct->type == ACT_EL_TYPE);
158+
if (ct->type != ACT_EL_TYPE) return NULL;
159159

160160
ref = ct->containedSubtype->value.v_type->reference;
161161

tests/tests-asn1c-compiler/139-component-relation-OK.asn1.-P

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef struct Frame {
2424
long ident;
2525
struct value {
2626
value_PR present;
27-
union value_u {
27+
union Frame__value_u {
2828
PrimitiveMessage_t PrimitiveMessage;
2929
ComplexMessage_t ComplexMessage;
3030
} choice;
@@ -81,7 +81,7 @@ memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
8181
}
8282

8383
static asn_type_selector_result_t
84-
select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
84+
select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
8585
asn_type_selector_result_t result = {0, 0};
8686
const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
8787
size_t constraining_column = 0; /* &id */
@@ -188,7 +188,7 @@ static asn_TYPE_member_t asn_MBR_Frame_1[] = {
188188
.tag = -1 /* Ambiguous tag (ANY?) */,
189189
.tag_mode = 0,
190190
.type = &asn_DEF_value_3,
191-
.type_selector = select_value_type,
191+
.type_selector = select_Frame_value_type,
192192
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
193193
0, 0, /* No default value */
194194
.name = "value"

tests/tests-asn1c-compiler/140-component-relation-OK.asn1.-P

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef struct Frame {
2424
long ident;
2525
struct value {
2626
value_PR present;
27-
union value_u {
27+
union Frame__value_u {
2828
PrimitiveMessage_t PrimitiveMessage;
2929
ComplexMessage_t ComplexMessage;
3030
} choice;
@@ -81,7 +81,7 @@ memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
8181
}
8282

8383
static asn_type_selector_result_t
84-
select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
84+
select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
8585
asn_type_selector_result_t result = {0, 0};
8686
const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
8787
size_t constraining_column = 0; /* &id */
@@ -188,7 +188,7 @@ static asn_TYPE_member_t asn_MBR_Frame_1[] = {
188188
.tag = -1 /* Ambiguous tag (ANY?) */,
189189
.tag_mode = 0,
190190
.type = &asn_DEF_value_3,
191-
.type_selector = select_value_type,
191+
.type_selector = select_Frame_value_type,
192192
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
193193
0, 0, /* No default value */
194194
.name = "value"

tests/tests-asn1c-compiler/141-component-relation-OK.asn1.-P

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef struct Frame {
2424
ConstrainedInteger_t ident;
2525
struct value {
2626
value_PR present;
27-
union value_u {
27+
union Frame__value_u {
2828
PrimitiveMessage_t PrimitiveMessage;
2929
ComplexMessage_t ComplexMessage;
3030
} choice;
@@ -87,7 +87,7 @@ memb_ident_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
8787
}
8888

8989
static asn_type_selector_result_t
90-
select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
90+
select_Frame_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
9191
asn_type_selector_result_t result = {0, 0};
9292
const asn_ioc_set_t *itable = asn_IOS_FrameTypes_1;
9393
size_t constraining_column = 0; /* &id */
@@ -194,7 +194,7 @@ static asn_TYPE_member_t asn_MBR_Frame_1[] = {
194194
.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
195195
.tag_mode = +1, /* EXPLICIT tag at current level */
196196
.type = &asn_DEF_value_3,
197-
.type_selector = select_value_type,
197+
.type_selector = select_Frame_value_type,
198198
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
199199
0, 0, /* No default value */
200200
.name = "value"

tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.-P

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typedef struct SpecializedContent_30P0 {
8686
long id;
8787
struct value {
8888
value_PR present;
89-
union value_u {
89+
union SpecializedContent_30P0__value_u {
9090
long INTEGER;
9191
BOOLEAN_t BOOLEAN;
9292
} choice;
@@ -141,7 +141,7 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
141141
}
142142

143143
static asn_type_selector_result_t
144-
select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
144+
select_SpecializedContent_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
145145
asn_type_selector_result_t result = {0, 0};
146146
const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1;
147147
size_t constraining_column = 0; /* &id */
@@ -248,7 +248,7 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = {
248248
.tag = -1 /* Ambiguous tag (ANY?) */,
249249
.tag_mode = 0,
250250
.type = &asn_DEF_value_3,
251-
.type_selector = select_value_type,
251+
.type_selector = select_SpecializedContent_30P0_value_type,
252252
{ .oer_constraints = 0, .per_constraints = 0, .general_constraints = memb_value_constraint_1 },
253253
0, 0, /* No default value */
254254
.name = "value"

tests/tests-asn1c-compiler/146-ios-parameterization-per-OK.asn1.-Pgen-PER

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ typedef struct SpecializedContent_30P0 {
8686
long id;
8787
struct value {
8888
value_PR present;
89-
union value_u {
89+
union SpecializedContent_30P0__value_u {
9090
long INTEGER;
9191
BOOLEAN_t BOOLEAN;
9292
} choice;
@@ -141,7 +141,7 @@ memb_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
141141
}
142142

143143
static asn_type_selector_result_t
144-
select_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
144+
select_SpecializedContent_30P0_value_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
145145
asn_type_selector_result_t result = {0, 0};
146146
const asn_ioc_set_t *itable = asn_IOS_RegionalExtension_1;
147147
size_t constraining_column = 0; /* &id */
@@ -264,7 +264,7 @@ asn_TYPE_member_t asn_MBR_SpecializedContent_30P0_1[] = {
264264
.tag = -1 /* Ambiguous tag (ANY?) */,
265265
.tag_mode = 0,
266266
.type = &asn_DEF_value_3,
267-
.type_selector = select_value_type,
267+
.type_selector = select_SpecializedContent_30P0_value_type,
268268
{ .oer_constraints = 0, .per_constraints = &asn_PER_memb_value_constr_3, .general_constraints = memb_value_constraint_1 },
269269
0, 0, /* No default value */
270270
.name = "value"

0 commit comments

Comments
 (0)