Fix crash during dealing with empty optinal fields of ioc cell
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index bebd413..73ccbdd 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -1070,6 +1070,8 @@
struct asn1p_ioc_cell_s *cell =
&opt_ioc->ioct->row[row]->column[column_index];
+ if(!cell->value) continue;
+
asn1p_expr_t *m = asn1p_expr_clone(cell->value, 0);
asn1p_expr_add(open_type_choice, m);
}
diff --git a/libasn1compiler/asn1c_ioc.c b/libasn1compiler/asn1c_ioc.c
index 02e37a7..bb72f7d 100644
--- a/libasn1compiler/asn1c_ioc.c
+++ b/libasn1compiler/asn1c_ioc.c
@@ -213,7 +213,9 @@
emit_ioc_cell(arg_t *arg, struct asn1p_ioc_cell_s *cell) {
OUT("{ \"%s\", ", cell->field->Identifier);
- if(cell->value->meta_type == AMT_VALUE) {
+ if(!cell->value) {
+ /* Ignore */
+ } else if(cell->value->meta_type == AMT_VALUE) {
GEN_INCLUDE(asn1c_type_name(arg, cell->value, TNF_INCLUDE));
OUT("aioc__value, ");
OUT("&asn_DEF_%s, ", asn1c_type_name(arg, cell->value, TNF_SAFE));