From b012da8fa08fe9cdbdce04ecd0c84e0c55ec8f52 Mon Sep 17 00:00:00 2001 From: vlm Date: Thu, 21 Jul 2005 01:18:19 +0000 Subject: [PATCH] tagging mode is implicit if automatic tags environment is used git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@938 59561ff5-6e30-0410-9f3c-9617f08c8826 --- ChangeLog | 7 ++++++- configure | 2 +- configure.in | 2 +- libasn1fix/asn1fix_constr.c | 3 ++- tests/55-components-of-OK.asn1.-EF | 2 +- tests/86-atags-OK.asn1 | 20 ++++++++++++++++++++ tests/86-atags-OK.asn1.-EF | 28 ++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 tests/86-atags-OK.asn1 create mode 100644 tests/86-atags-OK.asn1.-EF diff --git a/ChangeLog b/ChangeLog index 24075190..927f6ae8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ -0.9.16: 2005-July-04 +0.9.17: 2005-July-20 + + * Tagging mode is implicitly IMPLICIT if AUTOMATIC TAGS is used, #30.6. + (Test cases 55, 86). + +0.9.16: 2005-July-04 * GeneralizedTime API now supports fractions of seconds. Thanks to Bent Nicolaisen for support. diff --git a/configure b/configure index 9fe32ae2..3c4b2041 100755 --- a/configure +++ b/configure @@ -1881,7 +1881,7 @@ fi # Define the identity of the package. PACKAGE=asn1c - VERSION=0.9.16 + VERSION=0.9.17 cat >>confdefs.h <<_ACEOF diff --git a/configure.in b/configure.in index daeba6a7..ce9bd2ed 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ AC_INIT(libasn1parser/asn1p_y.y) AC_CANONICAL_BUILD AC_CANONICAL_TARGET AC_PREREQ(2.53) -AM_INIT_AUTOMAKE(asn1c, 0.9.16) +AM_INIT_AUTOMAKE(asn1c, 0.9.17) AM_MAINTAINER_MODE diff --git a/libasn1fix/asn1fix_constr.c b/libasn1fix/asn1fix_constr.c index b71d874c..588c08e8 100644 --- a/libasn1fix/asn1fix_constr.c +++ b/libasn1fix/asn1fix_constr.c @@ -252,7 +252,8 @@ asn1f_fix_constr_tag(arg_t *arg, int fix_top_level) { static int _asn1f_fix_type_tag(arg_t *arg, asn1p_expr_t *expr) { int must_explicit = _asn1f_check_if_tag_must_be_explicit(arg, expr); - int module_impl_tags = (arg->mod->module_flags & MSF_IMPLICIT_TAGS); + int module_impl_tags = (arg->mod->module_flags + & (MSF_IMPLICIT_TAGS | MSF_AUTOMATIC_TAGS)); int r_value = 0; if(expr->tag.tag_mode == TM_DEFAULT) { diff --git a/tests/55-components-of-OK.asn1.-EF b/tests/55-components-of-OK.asn1.-EF index b7b227fe..fb2f76df 100644 --- a/tests/55-components-of-OK.asn1.-EF +++ b/tests/55-components-of-OK.asn1.-EF @@ -5,7 +5,7 @@ BEGIN OneType ::= SEQUENCE { one-1 INTEGER, - one-2 [1] EXPLICIT BOOLEAN, + one-2 [1] IMPLICIT BOOLEAN, one-3 SEQUENCE { alpha [0] IMPLICIT INTEGER, beta [1] IMPLICIT INTEGER, diff --git a/tests/86-atags-OK.asn1 b/tests/86-atags-OK.asn1 new file mode 100644 index 00000000..afd05856 --- /dev/null +++ b/tests/86-atags-OK.asn1 @@ -0,0 +1,20 @@ + +-- OK: Everything is fine + +-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) +-- .spelio.software.asn1c.test (9363.1.5.1) +-- .86 + +ModuleAutoTags + { iso org(3) dod(6) internet (1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 86 } + DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + + A ::= SEQUENCE { a INTEGER } + B ::= SEQUENCE { a [0] INTEGER } + C ::= SEQUENCE { a [0] IMPLICIT INTEGER } + D ::= SEQUENCE { a [0] EXPLICIT INTEGER } + E ::= SEQUENCE { a [0] CHOICE { b INTEGER } } + +END diff --git a/tests/86-atags-OK.asn1.-EF b/tests/86-atags-OK.asn1.-EF new file mode 100644 index 00000000..ebadd3a5 --- /dev/null +++ b/tests/86-atags-OK.asn1.-EF @@ -0,0 +1,28 @@ +ModuleAutoTags { iso org(3) dod(6) internet(1) private(4) enterprise(1) + spelio(9363) software(1) asn1c(5) test(1) 86 } +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +A ::= SEQUENCE { + a [0] IMPLICIT INTEGER +} + +B ::= SEQUENCE { + a [0] IMPLICIT INTEGER +} + +C ::= SEQUENCE { + a [0] IMPLICIT INTEGER +} + +D ::= SEQUENCE { + a [0] EXPLICIT INTEGER +} + +E ::= SEQUENCE { + a [0] EXPLICIT CHOICE { + b [0] IMPLICIT INTEGER + } +} + +END