fixed explicitly tagged ANY type handling
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@497 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1fix/asn1fix_constr.c b/libasn1fix/asn1fix_constr.c
index d837f35..34970c9 100644
--- a/libasn1fix/asn1fix_constr.c
+++ b/libasn1fix/asn1fix_constr.c
@@ -250,20 +250,14 @@
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 fl_impl_tags = (arg->mod->module_flags & MSF_IMPLICIT_TAGS);
+ int module_impl_tags = (arg->mod->module_flags & MSF_IMPLICIT_TAGS);
int r_value = 0;
- if(fl_impl_tags) {
- if(expr->tag.tag_mode != TM_EXPLICIT) {
- if(must_explicit)
- expr->tag.tag_mode = TM_EXPLICIT;
- else
- expr->tag.tag_mode = TM_IMPLICIT;
- }
- } else {
- if(expr->tag.tag_mode == TM_DEFAULT) {
+ if(expr->tag.tag_mode == TM_DEFAULT) {
+ if(must_explicit || module_impl_tags == 0)
expr->tag.tag_mode = TM_EXPLICIT;
- }
+ else
+ expr->tag.tag_mode = TM_IMPLICIT;
}
/*