Add 64-bit integer support to ASN.1 compiler
ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending on whether the constraint ranges include numbers that cannot be represented in 32-bit ints and whether they include negative numbers. Template backend support included. check-template is now built with --template, so we know we're testing it. Tests included.
This commit is contained in:

committed by
Nicolas Williams

parent
0e7437ba2e
commit
19d378f44d
@@ -69,7 +69,7 @@ struct string_list {
|
||||
%}
|
||||
|
||||
%union {
|
||||
int constant;
|
||||
int64_t constant;
|
||||
struct value *value;
|
||||
struct range *range;
|
||||
char *name;
|
||||
@@ -370,14 +370,14 @@ range : '(' Value RANGE Value ')'
|
||||
lex_error_message("Non-integer in first part of range");
|
||||
$$ = ecalloc(1, sizeof(*$$));
|
||||
$$->min = $2->u.integervalue;
|
||||
$$->max = $2->u.integervalue - 1;
|
||||
$$->max = INT_MAX;
|
||||
}
|
||||
| '(' kw_MIN RANGE Value ')'
|
||||
{
|
||||
if($4->type != integervalue)
|
||||
lex_error_message("Non-integer in second part of range");
|
||||
$$ = ecalloc(1, sizeof(*$$));
|
||||
$$->min = $4->u.integervalue + 2;
|
||||
$$->min = INT_MIN;
|
||||
$$->max = $4->u.integervalue;
|
||||
}
|
||||
| '(' Value ')'
|
||||
|
Reference in New Issue
Block a user