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
88385388
Commit
88385388
authored
Mar 17, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
class dereference
parent
8c62613b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
0 deletions
+87
-0
libasn1fix/asn1fix_class.c
libasn1fix/asn1fix_class.c
+19
-0
tests/100-class-ref-OK.asn1
tests/100-class-ref-OK.asn1
+23
-0
tests/101-class-ref-SE.asn1
tests/101-class-ref-SE.asn1
+23
-0
tests/102-class-ref-SE.asn1
tests/102-class-ref-SE.asn1
+22
-0
No files found.
libasn1fix/asn1fix_class.c
View file @
88385388
...
@@ -25,6 +25,25 @@ asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
...
@@ -25,6 +25,25 @@ asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
errno
=
ESRCH
;
errno
=
ESRCH
;
return
NULL
;
return
NULL
;
}
}
if
(
ioclass
->
expr_type
==
A1TC_REFERENCE
)
{
ioclass
=
asn1f_lookup_symbol
(
arg
,
ioclass
->
module
,
ioclass
->
reference
);
if
(
ioclass
==
NULL
)
{
errno
=
ESRCH
;
return
NULL
;
}
}
if
(
ioclass
->
expr_type
!=
A1TC_CLASSDEF
)
{
if
(
!
(
ioclass
->
_mark
&
TM_BROKEN
))
{
ioclass
->
_mark
|=
TM_BROKEN
;
FATAL
(
"Class field %s lookup at line %d in something that is not a class: %s at line %d"
,
asn1f_printable_reference
(
ref
),
ref
->
_lineno
,
ioclass
->
Identifier
,
ioclass
->
_lineno
);
}
errno
=
EINVAL
;
return
NULL
;
}
classfield
=
asn1f_lookup_child
(
ioclass
,
ref
->
components
[
1
].
name
);
classfield
=
asn1f_lookup_child
(
ioclass
,
ref
->
components
[
1
].
name
);
if
(
classfield
==
NULL
)
{
if
(
classfield
==
NULL
)
{
...
...
tests/100-class-ref-OK.asn1
0 → 100644
View file @
88385388
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .100
ModuleClassSample
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 100 }
DEFINITIONS ::=
BEGIN
REF-ID ::= TYPE-IDENTIFIER
RefID ::= SEQUENCE {
field REF-ID.&id,
params REF-ID.&Type
}
SupportedReferences REF-ID ::= { ... }
END
tests/101-class-ref-SE.asn1
0 → 100644
View file @
88385388
-- SE: Semantic error
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .101
ModuleClassMisUse
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 101 }
DEFINITIONS ::=
BEGIN
NOTCLASS ::= SEQUENCE { ... }
REF-ID ::= NOTCLASS
RefID ::= SEQUENCE {
field REF-ID.&id,
params REF-ID.&Type
}
END
tests/102-class-ref-SE.asn1
0 → 100644
View file @
88385388
-- SE: Semantic error
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .102
ModuleClassMisUse
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 102 }
DEFINITIONS ::=
BEGIN
REF-ID ::= REF-ID2
REF-ID2 ::= REF-ID
RefID ::= SEQUENCE {
field REF-ID.&id,
params REF-ID.&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