Commit 069c0765 authored by Bi-Ruei, Chiu's avatar Bi-Ruei, Chiu Committed by Lev Walkin

Fix crash during dealing with empty optinal fields of ioc cell

parent aeff717b
......@@ -1070,6 +1070,8 @@ asn1c_lang_C_OpenType(arg_t *arg, asn1c_ioc_table_and_objset_t *opt_ioc,
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);
}
......
......@@ -213,7 +213,9 @@ static int
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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment