removed order dependency in DEFAULT references

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@577 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2004-10-31 00:11:50 +00:00
parent 8e1d2fc0f6
commit 7972927fbc
5 changed files with 44 additions and 1 deletions

View File

@ -1,5 +1,5 @@
0.9.8: 2004-Oct-26
0.9.8: 2004-Oct-30
* [NEW PLATFORM] Compiled and tested on Linux @ alpha64 (LP64).
Some code needed to be fixed regarding int-long conversions
@ -13,6 +13,8 @@
* Empty SEQUENCE and SET clauses are now allowed.
* Removed confusion between &xNN; and &#xNN; in enber and unber.
* ber_dec_rval_t renamed into asn_dec_rval_t: more generality.
* Removed order dependency in DEFAULT references to ENUMERATED
identifiers (./tests/68-*-OK.asn1).
0.9.7.1: 2004-Oct-12

View File

@ -261,6 +261,12 @@ asn1f_fix_module__phase_2(arg_t *arg) {
/* Do not process the parametrized types here */
continue;
/*
* Dereference DEFAULT values.
*/
ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_defaults);
RET2RVAL(ret, rvalue);
/*
* Check semantic validity of constraints.
*/

View File

@ -15,6 +15,18 @@ asn1f_fix_dereference_values(arg_t *arg) {
}
}
return r_value;
}
/*
* Dereference DEFAULT values
*/
int
asn1f_fix_dereference_defaults(arg_t *arg) {
asn1p_expr_t *expr = arg->expr;
int r_value = 0;
if(expr->marker.default_value) {
arg_t tmparg = *arg;
asn1p_expr_t tmpexpr = *expr;

View File

@ -3,4 +3,6 @@
int asn1f_fix_dereference_values(arg_t *);
int asn1f_fix_dereference_defaults(arg_t *);
#endif /* _ASN1FIX_DEREFV_H_ */

View File

@ -0,0 +1,21 @@
-- OK: Everything is Fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .68
ModuleTestEnumeratedDefault
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 68 }
DEFINITIONS ::=
BEGIN
Type ::= SEQUENCE {
reportAmount ReportAmount DEFAULT ra-default,
reportInterval INTEGER
}
ReportAmount ::= ENUMERATED { a, b, c, ra-default }
END