Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
asn1c
Commits
ef4a32bd
Commit
ef4a32bd
authored
18 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
test whether bit string values are identifiers
parent
0f8d4a41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libasn1fix/asn1fix_bitstring.c
+26
-2
26 additions, 2 deletions
libasn1fix/asn1fix_bitstring.c
tests/109-bit-string-SE.asn1
+16
-0
16 additions, 0 deletions
tests/109-bit-string-SE.asn1
with
42 additions
and
2 deletions
libasn1fix/asn1fix_bitstring.c
+
26
−
2
View file @
ef4a32bd
#include
"asn1fix_internal.h"
int
asn1f_fix_bit_string_value
(
arg_t
*
arg
,
asn1p_expr_t
*
ttype
);
static
int
asn1f_fix_bit_string_type
(
arg_t
*
arg
);
static
int
asn1f_fix_bit_string_value
(
arg_t
*
arg
,
asn1p_expr_t
*
ttype
);
static
void
asn1f_BS_remove_trailing_zero_bits
(
asn1p_value_t
*
value
);
static
int
asn1f_BS_unparsed_convert
(
arg_t
*
arg
,
asn1p_value_t
*
value
,
asn1p_expr_t
*
ttype
);
...
...
@@ -22,10 +23,33 @@ asn1f_fix_bit_string(arg_t *arg) {
}
}
if
(
expr
->
meta_type
==
AMT_TYPE
&&
expr
->
expr_type
==
ASN_BASIC_BIT_STRING
)
{
ret
=
asn1f_fix_bit_string_type
(
arg
);
RET2RVAL
(
ret
,
r_value
);
}
return
r_value
;
}
int
static
int
asn1f_fix_bit_string_type
(
arg_t
*
arg
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
asn1p_expr_t
*
v
;
TQ_FOR
(
v
,
&
(
expr
->
members
),
next
)
{
if
(
v
->
expr_type
!=
A1TC_UNIVERVAL
)
{
FATAL
(
"BIT STRING value at line %d "
"is not an identifier"
,
v
->
_lineno
);
return
-
1
;
}
}
return
0
;
}
static
int
asn1f_fix_bit_string_value
(
arg_t
*
arg
,
asn1p_expr_t
*
ttype
)
{
asn1p_expr_t
*
expr
=
arg
->
expr
;
int
r_value
=
0
;
...
...
This diff is collapsed.
Click to expand it.
tests/109-bit-string-SE.asn1
0 → 100644
+
16
−
0
View file @
ef4a32bd
-- SE: Semantic error
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .109
ModuleBitStringExtensibility
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 109 }
DEFINITIONS ::=
BEGIN
T ::= BIT STRING { one(1), ... }
END
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment