Commit ceac1544 authored by Lev Walkin's avatar Lev Walkin

non-negative value

parent 0c27dd45
...@@ -55,6 +55,25 @@ asn1f_fix_bit_string_type(arg_t *arg) { ...@@ -55,6 +55,25 @@ asn1f_fix_bit_string_type(arg_t *arg) {
"is not an identifier", v->_lineno); "is not an identifier", v->_lineno);
return -1; return -1;
} }
/* 21.1 */
if(v->value == NULL) {
FATAL("BIT STRING NamedBit value at line %d "
"must be explicitly specified in braces",
v->_lineno);
return -1;
} else if(v->value->type == ATV_REFERENCED) {
/* Resolve the value */
if(asn1f_value_resolve(arg, v, 0))
return -1;
}
if(v->value->type != ATV_INTEGER
|| v->value->value.v_integer < 0) {
FATAL("BIT STRING NamedBit value at line %d: "
"non-negative integer value expected",
v->_lineno);
return -1;
}
} }
return r_value; return r_value;
......
-- SE: Semantic error
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .114
ModuleBitStringNegativeInteger
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 114 }
DEFINITIONS ::=
BEGIN
T ::= BIT STRING { one(-2) }
END
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