Fix compile SAE J2735_201603DA.ASN issue
These are unmerged lines of code that I forgot adding in pull request #154.
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index 16f7f3c..820ebf7 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -2670,8 +2670,6 @@
asn1p_expr_t *expr = arg->expr;
char *id;
- assert(expr->Identifier);
-
if((arg->flags & A1C_COMPOUND_NAMES
|| onc_flags & ONC_force_compound_name)
&& ((expr->expr_type & ASN_CONSTR_MASK)
@@ -2680,8 +2678,8 @@
|| expr->expr_type == ASN_BASIC_BIT_STRING)
&& expr_elements_count(arg, expr))
)
- && expr->parent_expr
- && expr->parent_expr->Identifier) {
+ && expr->parent_expr) {
+
arg_t tmparg = *arg;
tmparg.expr = expr->parent_expr;
@@ -2689,7 +2687,7 @@
out_name_chain(&tmparg, onc_flags);
- OUT("__"); /* a separator between id components */
+ if(expr->parent_expr->Identifier) OUT("__"); /* a separator between id components */
/* Fall through */
}
diff --git a/libasn1compiler/asn1c_misc.c b/libasn1compiler/asn1c_misc.c
index 40be51b..76c06d8 100644
--- a/libasn1compiler/asn1c_misc.c
+++ b/libasn1compiler/asn1c_misc.c
@@ -221,7 +221,7 @@
}
}
- if(_format != TNF_RSAFE && terminal && terminal->spec_index != -1) {
+ if(_format != TNF_RSAFE && terminal && ((terminal->spec_index != -1) || (terminal->_mark & TM_NAMECLASH))) {
exprid = terminal;
typename = 0;
}