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
201943eb
Commit
201943eb
authored
Sep 04, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support for ANY type
parent
2605d2a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
libasn1compiler/asn1c_C.c
libasn1compiler/asn1c_C.c
+22
-6
No files found.
libasn1compiler/asn1c_C.c
View file @
201943eb
...
...
@@ -906,7 +906,7 @@ _print_tag(arg_t *arg, asn1p_expr_t *expr, struct asn1p_type_tag_s *tag_p) {
tag
=
*
tag_p
;
}
else
{
if
(
asn1f_fetch_tag
(
arg
->
asn
,
arg
->
mod
,
expr
,
&
tag
))
{
OUT
(
"-1 /* Ambiguous tag (CHOICE?) */"
);
OUT
(
"-1 /* Ambiguous tag (CHOICE
|ANY
?) */"
);
return
0
;
}
}
...
...
@@ -1028,8 +1028,11 @@ _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no) {
ret
=
asn1f_fetch_tag
(
arg
->
asn
,
arg
->
mod
,
arg
->
expr
,
&
tag
);
if
(
ret
==
0
)
{
tag2el_t
*
te
;
int
new_count
=
(
*
count
)
+
1
;
void
*
p
;
p
=
realloc
(
*
tag2el
,
sizeof
(
tag2el_t
)
*
((
*
count
)
+
1
));
p
=
realloc
(
*
tag2el
,
new_count
*
sizeof
(
tag2el_t
));
if
(
p
)
*
tag2el
=
p
;
else
return
-
1
;
...
...
@@ -1037,10 +1040,11 @@ _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no) {
arg
->
expr
->
Identifier
,
(
long
)
tag
.
tag_value
);
(
*
tag2el
)[
*
count
].
el_tag
=
tag
;
(
*
tag2el
)[
*
count
].
el_no
=
el_no
;
(
*
tag2el
)[
*
count
].
from_expr
=
arg
->
expr
;
(
*
count
)
++
;
te
=
&
((
*
tag2el
)[
*
count
]);
te
->
el_tag
=
tag
;
te
->
el_no
=
el_no
;
te
->
from_expr
=
arg
->
expr
;
*
count
=
new_count
;
return
0
;
}
...
...
@@ -1073,6 +1077,18 @@ _add_tag2el_member(arg_t *arg, tag2el_t **tag2el, int *count, int el_no) {
}
}
if
(
arg
->
expr
->
expr_type
==
ASN_TYPE_ANY
&&
arg
->
expr
->
tag
.
tag_class
==
TC_NOCLASS
)
{
if
(
arg
->
expr
->
marker
)
{
FATAL
(
"Untagged optional ANY type for %s at line %d"
,
arg
->
expr
->
Identifier
,
arg
->
expr
->
_lineno
);
return
-
1
;
}
/* Allow to proceed without adding a tag */
return
0
;
}
DEBUG
(
"No tag for %s at line %d"
,
arg
->
expr
->
Identifier
,
arg
->
expr
->
_lineno
);
...
...
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