specialization fix, tested on value specialization
diff --git a/tests/tests-asn1c-compiler/143-inner-parameterization-OK.asn1.-P b/tests/tests-asn1c-compiler/143-inner-parameterization-OK.asn1.-P
new file mode 100644
index 0000000..e871047
--- /dev/null
+++ b/tests/tests-asn1c-compiler/143-inner-parameterization-OK.asn1.-P
@@ -0,0 +1,284 @@
+
+/*** <<< INCLUDES [Message] >>> ***/
+
+#include "SpecializedContent.h"
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Message] >>> ***/
+
+typedef struct Message {
+ SpecializedContent_21P0_t content13;
+ SpecializedContent_21P1_t content42;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Message_t;
+
+/*** <<< FUNC-DECLS [Message] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Message;
+
+/*** <<< STAT-DEFS [Message] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Message_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Message, content13),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_SpecializedContent_21P0,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "content13"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Message, content42),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_SpecializedContent_21P1,
+ .type_selector = 0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "content42"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_Message_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_Message_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* content13 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 } /* content42 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Message_specs_1 = {
+ sizeof(struct Message),
+ offsetof(struct Message, _asn_ctx),
+ asn_MAP_Message_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Message = {
+ "Message",
+ "Message",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Message_tags_1,
+ sizeof(asn_DEF_Message_tags_1)
+ /sizeof(asn_DEF_Message_tags_1[0]), /* 1 */
+ asn_DEF_Message_tags_1, /* Same as above */
+ sizeof(asn_DEF_Message_tags_1)
+ /sizeof(asn_DEF_Message_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_Message_1,
+ 2, /* Elements count */
+ &asn_SPC_Message_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SpecializedContent] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [SpecializedContent] >>> ***/
+
+typedef struct SpecializedContent_21P0 {
+ long id;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SpecializedContent_21P0_t;
+typedef struct SpecializedContent_21P1 {
+ long id;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SpecializedContent_21P1_t;
+
+/*** <<< FUNC-DECLS [SpecializedContent] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SpecializedContent_21P0;
+extern asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_21P0_specs_1;
+extern asn_TYPE_member_t asn_MBR_SpecializedContent_21P0_1[1];
+extern asn_TYPE_descriptor_t asn_DEF_SpecializedContent_21P1;
+extern asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_21P1_specs_3;
+extern asn_TYPE_member_t asn_MBR_SpecializedContent_21P1_3[1];
+
+/*** <<< CODE [SpecializedContent] >>> ***/
+
+static int
+memb_id_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 13)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+static int
+memb_id_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_constraint_failed_f *ctfailcb, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value == 42)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ ASN__CTFAIL(app_key, td, sptr,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [SpecializedContent] >>> ***/
+
+asn_TYPE_member_t asn_MBR_SpecializedContent_21P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_21P0, id),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_id_constraint_1,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "id"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SpecializedContent_21P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_21P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_21P0_specs_1 = {
+ sizeof(struct SpecializedContent_21P0),
+ offsetof(struct SpecializedContent_21P0, _asn_ctx),
+ asn_MAP_SpecializedContent_21P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SpecializedContent_21P0 = {
+ "SpecializedContent",
+ "SpecializedContent",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SpecializedContent_21P0_tags_1,
+ sizeof(asn_DEF_SpecializedContent_21P0_tags_1)
+ /sizeof(asn_DEF_SpecializedContent_21P0_tags_1[0]), /* 1 */
+ asn_DEF_SpecializedContent_21P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_SpecializedContent_21P0_tags_1)
+ /sizeof(asn_DEF_SpecializedContent_21P0_tags_1[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SpecializedContent_21P0_1,
+ 1, /* Elements count */
+ &asn_SPC_SpecializedContent_21P0_specs_1 /* Additional specs */
+};
+
+asn_TYPE_member_t asn_MBR_SpecializedContent_21P1_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SpecializedContent_21P1, id),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .type_selector = 0,
+ .memb_constraints = memb_id_constraint_3,
+ .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "id"
+ },
+};
+static const ber_tlv_tag_t asn_DEF_SpecializedContent_21P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static const asn_TYPE_tag2member_t asn_MAP_SpecializedContent_21P1_tag2el_3[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* id */
+};
+asn_SEQUENCE_specifics_t asn_SPC_SpecializedContent_21P1_specs_3 = {
+ sizeof(struct SpecializedContent_21P1),
+ offsetof(struct SpecializedContent_21P1, _asn_ctx),
+ asn_MAP_SpecializedContent_21P1_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SpecializedContent_21P1 = {
+ "SpecializedContent",
+ "SpecializedContent",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_compare,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, 0, /* No OER support, use "-gen-OER" to enable */
+ 0, 0, /* No PER support, use "-gen-PER" to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SpecializedContent_21P1_tags_3,
+ sizeof(asn_DEF_SpecializedContent_21P1_tags_3)
+ /sizeof(asn_DEF_SpecializedContent_21P1_tags_3[0]), /* 1 */
+ asn_DEF_SpecializedContent_21P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_SpecializedContent_21P1_tags_3)
+ /sizeof(asn_DEF_SpecializedContent_21P1_tags_3[0]), /* 1 */
+ 0, /* No OER visible constraints */
+ 0, /* No PER visible constraints */
+ asn_MBR_SpecializedContent_21P1_3,
+ 1, /* Elements count */
+ &asn_SPC_SpecializedContent_21P1_specs_3 /* Additional specs */
+};
+