diff options
author | Lev Walkin <vlm@lionet.info> | 2005-06-02 05:21:53 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2005-06-02 05:21:53 +0000 |
commit | 7116096839f8c5597086f43a47d67a52a34027e0 (patch) | |
tree | 220d7dc2123065e5c6f9af5bec49f16ec1d456fc /libasn1fix | |
parent | f3b29b1fa888a83260fe1b23f0a07bdbe0040c3e (diff) |
Compiler support for tagged parametrized members.
Diffstat (limited to 'libasn1fix')
-rw-r--r-- | libasn1fix/asn1fix_constr.c | 7 | ||||
-rw-r--r-- | libasn1fix/asn1fix_param.c | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libasn1fix/asn1fix_constr.c b/libasn1fix/asn1fix_constr.c index e16c9e04..b71d874c 100644 --- a/libasn1fix/asn1fix_constr.c +++ b/libasn1fix/asn1fix_constr.c @@ -419,6 +419,7 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { || ta.tag_value == -1 /* Spread IMAGINARY ANY tag... */ || tb.tag_value == -1 /* ...it is an evil virus, fear it! */ ) { + char tagbuf[2][TAG2STRING_BUFFER_SIZE]; char *p = (a->expr_type == A1TC_EXTENSIBLE) ?"potentially ":""; FATAL("Processing %s at line %d: component \"%s\" at line %d %shas the same tag " @@ -431,6 +432,12 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) { b->Identifier, b->_lineno ); + DEBUG("Tags: %s %s vs. %s %s", + asn1p_tag2string(&ta, tagbuf[0]), + a->Identifier, + asn1p_tag2string(&tb, tagbuf[1]), + b->Identifier + ); if((arg->mod->module_flags & MSF_EXTENSIBILITY_IMPLIED) && (a->expr_type == A1TC_EXTENSIBLE) && (b->expr_type == A1TC_EXTENSIBLE)) { diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c index 3fdaf307..8c9ce41a 100644 --- a/libasn1fix/asn1fix_param.c +++ b/libasn1fix/asn1fix_param.c @@ -60,12 +60,22 @@ asn1f_fix_parametrized_assignment(arg_t *arg) { #define SUBSTITUTE(to, from) do { \ asn1p_expr_t tmp, *__v; \ + if((to)->tag.tag_class \ + && (from)->tag.tag_class) { \ + FATAL("Layered tagging " \ + "in parametrization " \ + "is not yet supported, " \ + "contact asn1c author for"); \ + return -1; \ + } \ tmp = *(to); \ *(to) = *(from); \ TQ_MOVE(&(to)->members, &(from)->members); \ *(from) = tmp; \ (to)->next = tmp.next; \ (to)->parent_expr = tmp.parent_expr; \ + if(tmp.tag.tag_class) \ + (to)->tag = tmp.tag; \ memset(&((from)->next), 0, \ sizeof((from)->next)); \ memset(&((from)->members), 0, \ |