Skip to content
Snippets Groups Projects
Commit 7ef83a45 authored by Lev Walkin's avatar Lev Walkin
Browse files

deeper validation

parent fc776437
No related branches found
No related tags found
No related merge requests found
...@@ -1067,7 +1067,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) { ...@@ -1067,7 +1067,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("td->elements_count = asn_DEF_%s.elements_count;\n", type_name); OUT("td->elements_count = asn_DEF_%s.elements_count;\n", type_name);
if(etd_spec != ETD_NO_SPECIFICS) { if(etd_spec != ETD_NO_SPECIFICS) {
INDENT(-1); INDENT(-1);
OUT(" /* "); OUT(" /* ");
} }
OUT("td->specifics = asn_DEF_%s.specifics;", type_name); OUT("td->specifics = asn_DEF_%s.specifics;", type_name);
if(etd_spec == ETD_NO_SPECIFICS) { if(etd_spec == ETD_NO_SPECIFICS) {
......
...@@ -170,8 +170,17 @@ asn1c_emit_constraint_checking_code(arg_t *arg) { ...@@ -170,8 +170,17 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
INDENT(-1); INDENT(-1);
OUT(") {\n"); OUT(") {\n");
INDENT(+1); INDENT(+1);
OUT("/* Constraint check succeeded */\n"); switch(etype) {
OUT("return 0;\n"); case ASN_CONSTR_SEQUENCE_OF:
OUT("/* SEQUENCE validation code is the same as SET */\n");
case ASN_CONSTR_SET_OF:
OUT("/* Perform validation of the inner elements */\n");
OUT("return SET_OF_constraint(td, list, app_errlog, app_key);\n");
break;
default:
OUT("/* Constraint check succeeded */\n");
OUT("return 0;\n");
}
INDENT(-1); INDENT(-1);
OUT("} else {\n"); OUT("} else {\n");
INDENT(+1); INDENT(+1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment