Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
41635d33
Commit
41635d33
authored
Mar 18, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
references
parent
d404427f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
13 deletions
+47
-13
libasn1fix/asn1fix.c
libasn1fix/asn1fix.c
+2
-1
libasn1fix/asn1fix_cws.c
libasn1fix/asn1fix_cws.c
+2
-2
libasn1fix/asn1fix_dereft.c
libasn1fix/asn1fix_dereft.c
+5
-1
libasn1fix/asn1fix_retrieve.c
libasn1fix/asn1fix_retrieve.c
+19
-6
skeletons/NativeEnumerated.c
skeletons/NativeEnumerated.c
+1
-1
skeletons/NativeInteger.c
skeletons/NativeInteger.c
+1
-1
skeletons/NativeReal.c
skeletons/NativeReal.c
+1
-1
tests/103-reference-SE.asn1
tests/103-reference-SE.asn1
+16
-0
No files found.
libasn1fix/asn1fix.c
View file @
41635d33
...
...
@@ -477,7 +477,8 @@ asn1f_check_duplicate(arg_t *arg) {
"ASN.1 expression
\"
%s
\"
at line %d of module %s
\n
"
"clashes with expression
\"
%s
\"
at line %d of module %s"
"%s%s%s.
\n
"
"Please rename either instance to resolve the conflict"
,
"Rename or remove either instance "
"to resolve the conflict"
,
arg
->
expr
->
Identifier
,
arg
->
expr
->
_lineno
,
arg
->
mod
->
ModuleName
,
...
...
libasn1fix/asn1fix_cws.c
View file @
41635d33
...
...
@@ -188,7 +188,7 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_i
if
(
isdigit
(
*
p
))
{
asn1c_integer_t
value
;
if
(
asn1p_atoi
(
p
,
&
value
))
{
FATAL
(
"Value %s at line %d is too large for this compiler!
Please c
ontact the asn1c author.
\n
"
,
p
,
arg
->
expr
->
_lineno
);
FATAL
(
"Value %s at line %d is too large for this compiler!
C
ontact the asn1c author.
\n
"
,
p
,
arg
->
expr
->
_lineno
);
return
-
1
;
}
expr
=
asn1p_expr_new
(
arg
->
expr
->
_lineno
);
...
...
@@ -197,7 +197,7 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_i
expr
->
expr_type
=
ASN_BASIC_INTEGER
;
expr
->
value
=
asn1p_value_fromint
(
value
);
}
else
{
WARNING
(
"asn1c is not yet able to parse arbitrary direct values;
please convert
%s at line %d to a reference."
,
p
,
arg
->
expr
->
_lineno
);
WARNING
(
"asn1c is not yet able to parse arbitrary direct values;
try converting
%s at line %d to a reference."
,
p
,
arg
->
expr
->
_lineno
);
free
(
p
);
return
1
;
}
...
...
libasn1fix/asn1fix_dereft.c
View file @
41635d33
...
...
@@ -29,6 +29,7 @@ asn1f_fix_dereference_types(arg_t *arg) {
type_expr
=
asn1f_find_terminal_type
(
arg
,
expr
);
if
(
type_expr
==
NULL
)
{
const
char
*
type_name
;
asn1p_expr_t
*
idexpr
;
if
(
errno
==
EEXIST
)
{
/* Ignore missing type
...
...
@@ -39,8 +40,11 @@ asn1f_fix_dereference_types(arg_t *arg) {
}
type_name
=
asn1f_printable_reference
(
expr
->
reference
);
/* Avoid NULL in case of unnamed T ::= SEQUENCE OF ... */
for
(
idexpr
=
expr
;
!
idexpr
->
Identifier
&&
idexpr
->
parent_expr
;
idexpr
=
idexpr
->
parent_expr
);
FATAL
(
"Unknown type
\"
%s
\"
referenced by
\"
%s
\"
at line %d"
,
type_name
,
expr
->
Identifier
,
expr
->
_lineno
);
type_name
,
id
expr
->
Identifier
,
expr
->
_lineno
);
return
-
1
;
}
...
...
libasn1fix/asn1fix_retrieve.c
View file @
41635d33
...
...
@@ -58,7 +58,8 @@ asn1f_lookup_in_imports(arg_t *arg, asn1p_module_t *mod, const char *name) {
arg
->
expr
->
_mark
|=
TM_BROKEN
;
FATAL
(
"Cannot find external module
\"
%s
\"
"
"mentioned for "
"
\"
%s
\"
at line %d"
,
"
\"
%s
\"
at line %d. "
"Obtain this module and instruct compiler to process it too."
,
xp
->
fromModuleName
,
name
,
arg
->
expr
->
_lineno
);
}
/* ENOENT/ETOOMANYREFS */
...
...
@@ -144,10 +145,8 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
return
NULL
;
}
asn1p_expr_t
*
asn1f_lookup_symbol
(
arg_t
*
arg
,
asn1p_module_t
*
mod
,
asn1p_ref_t
*
ref
)
{
static
asn1p_expr_t
*
asn1f_lookup_symbol_impl
(
arg_t
*
arg
,
asn1p_module_t
*
mod
,
asn1p_ref_t
*
ref
,
int
recursion_depth
)
{
asn1p_expr_t
*
ref_tc
;
/* Referenced tc */
asn1p_module_t
*
imports_from
;
char
*
modulename
;
...
...
@@ -170,6 +169,15 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
mod
->
ModuleName
,
ref
->
_lineno
);
if
(
recursion_depth
++
>
30
/* Arbitrary constant */
)
{
FATAL
(
"Excessive circular referencing detected in module %s for %s at line %d"
,
mod
->
ModuleName
,
asn1f_printable_reference
(
ref
),
ref
->
_lineno
);
errno
=
ETOOMANYREFS
;
return
NULL
;
}
if
(
ref
->
comp_count
==
1
)
{
modulename
=
NULL
;
identifier
=
ref
->
components
[
0
].
name
;
...
...
@@ -247,7 +255,7 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
assert
(
tmpref
.
comp_count
>
0
);
}
expr
=
asn1f_lookup_symbol
(
arg
,
imports_from
,
&
tmpref
);
expr
=
asn1f_lookup_symbol
_impl
(
arg
,
imports_from
,
&
tmpref
,
recursion_depth
);
if
(
!
expr
&&
!
(
arg
->
expr
->
_mark
&
TM_BROKEN
)
&&
!
(
imports_from
->
_tags
&
MT_STANDARD_MODULE
))
{
arg
->
expr
->
_mark
|=
TM_BROKEN
;
...
...
@@ -326,6 +334,11 @@ asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
}
asn1p_expr_t
*
asn1f_lookup_symbol
(
arg_t
*
arg
,
asn1p_module_t
*
mod
,
asn1p_ref_t
*
ref
)
{
return
asn1f_lookup_symbol_impl
(
arg
,
mod
,
ref
,
0
);
}
asn1p_expr_t
*
asn1f_find_terminal_type
(
arg_t
*
arg
,
asn1p_expr_t
*
expr
)
{
return
asn1f_find_terminal_thing
(
arg
,
expr
,
FTT_TYPE
);
...
...
skeletons/NativeEnumerated.c
View file @
41635d33
...
...
@@ -3,7 +3,7 @@
* Redistribution and modifications are permitted subject to BSD license.
*/
/*
*
Please r
ead the NativeInteger.h for the explanation wrt. differences between
*
R
ead the NativeInteger.h for the explanation wrt. differences between
* INTEGER and NativeInteger.
* Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
* implementation deals with the standard (machine-specific) representation
...
...
skeletons/NativeInteger.c
View file @
41635d33
...
...
@@ -3,7 +3,7 @@
* Redistribution and modifications are permitted subject to BSD license.
*/
/*
*
Please r
ead the NativeInteger.h for the explanation wrt. differences between
*
R
ead the NativeInteger.h for the explanation wrt. differences between
* INTEGER and NativeInteger.
* Basically, both are decoders and encoders of ASN.1 INTEGER type, but this
* implementation deals with the standard (machine-specific) representation
...
...
skeletons/NativeReal.c
View file @
41635d33
...
...
@@ -3,7 +3,7 @@
* Redistribution and modifications are permitted subject to BSD license.
*/
/*
*
Please r
ead the NativeReal.h for the explanation wrt. differences between
*
R
ead the NativeReal.h for the explanation wrt. differences between
* REAL and NativeReal.
* Basically, both are decoders and encoders of ASN.1 REAL type, but this
* implementation deals with the standard (machine-specific) representation
...
...
tests/103-reference-SE.asn1
0 → 100644
View file @
41635d33
-- SE: Semantic error
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .102
ModuleReference
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 102 }
DEFINITIONS ::=
BEGIN
IMPORTS Type FROM ModuleReference;
T ::= SEQUENCE OF Type
END
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment