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
9fb53597
Commit
9fb53597
authored
Sep 15, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dereferencing DEFAULT value
parent
fd97d5ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
35 deletions
+19
-35
libasn1fix/asn1fix_derefv.c
libasn1fix/asn1fix_derefv.c
+19
-35
No files found.
libasn1fix/asn1fix_derefv.c
View file @
9fb53597
...
...
@@ -8,47 +8,31 @@ asn1f_fix_dereference_values(arg_t *arg) {
asn1p_expr_t
*
expr
=
arg
->
expr
;
int
r_value
=
0
;
if
(
expr
->
meta_type
!=
AMT_VALUE
)
return
0
;
/* Just ignore it */
if
(
expr
->
value
==
NULL
)
return
0
;
/* Just ignore it */
if
(
expr
->
value
&&
expr
->
value
->
type
!=
ATV_REFERENCED
)
return
0
;
/* Not a reference */
DEBUG
(
"%s(%s %x ::= %s) for line %d"
,
__func__
,
expr
->
Identifier
,
expr
->
expr_type
,
asn1f_printable_value
(
expr
->
value
),
expr
->
_lineno
);
/*
* If this integer has a value, check that this value
* is an integer. If it is a reference, resolve it.
*/
if
(
expr
->
value
)
{
if
(
expr
->
value
&&
expr
->
meta_type
==
AMT_VALUE
)
{
if
(
asn1f_value_resolve
(
arg
,
expr
))
{
/* This function will emit messages */
r_value
=
-
1
;
}
}
if
(
0
&&
expr
->
value
->
type
!=
ATV_INTEGER
)
{
FATAL
(
"INTEGER value %s at line %d: "
"Incompatible value specified: %s"
,
expr
->
Identifier
,
expr
->
_lineno
,
asn1f_printable_value
(
expr
->
value
)
);
r_value
=
-
1
;
if
(
expr
->
marker
.
default_value
)
{
arg_t
tmparg
=
*
arg
;
asn1p_expr_t
tmpexpr
=
*
expr
;
switch
(
expr
->
marker
.
default_value
->
type
)
{
default:
return
r_value
;
case
ATV_REFERENCED
:
break
;
}
}
else
{
FATAL
(
"Value of
\"
%s
\"
at line %d: "
"Incompatible value specified"
,
expr
->
Identifier
,
expr
->
_lineno
);
r_value
=
-
1
;
tmparg
.
expr
=
&
tmpexpr
;
tmpexpr
.
meta_type
=
AMT_VALUE
;
tmpexpr
.
marker
.
default_value
=
0
;
tmpexpr
.
value
=
expr
->
marker
.
default_value
;
if
(
asn1f_value_resolve
(
&
tmparg
,
&
tmpexpr
))
r_value
=
-
1
;
expr
->
marker
.
default_value
=
tmpexpr
.
value
;
}
return
r_value
;
...
...
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