From: Graham B. <gb...@us...> - 2002-08-19 23:51:41
|
Update of /cvsroot/perl-ldap/asn/lib/Convert/ASN1 In directory usw-pr-cvs1:/tmp/cvs-serv7018/lib/Convert/ASN1 Modified Files: _encode.pm parser.pm Log Message: Fix for nested CHOICEs and tagged CHOICEs in SEQUENCES Index: _encode.pm =================================================================== RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/_encode.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- _encode.pm 15 Feb 2002 06:51:45 -0000 1.15 +++ _encode.pm 19 Aug 2002 23:51:38 -0000 1.16 @@ -348,7 +348,8 @@ my $stash = defined($_[3]) ? $_[3] : $_[2]; for my $op (@{$_[1]->[cCHILD]}) { - my $var = $op->[cVAR]; + my $var = defined $op->[cVAR] ? $op->[cVAR] : $op->[cCHILD]->[0]->[cVAR]; + if (exists $stash->{$var}) { push @{$_[6]}, $var; _encode($_[0],[$op], $stash, $_[6], $_[4]); Index: parser.pm =================================================================== RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/parser.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- parser.pm 25 Mar 2002 07:39:46 -0000 1.8 +++ parser.pm 19 Aug 2002 23:51:38 -0000 1.9 @@ -696,7 +696,10 @@ compile_one($tree, $op->[cCHILD], defined($op->[cVAR]) ? $name . "." . $op->[cVAR] : $name); ;# If a CHOICE is given a tag, then it must be EXPLICIT - $op = explicit($op) if $op->[cTYPE] == opCHOICE && defined($op->[cTAG]) && length($op->[cTAG]); + if ($op->[cTYPE] == opCHOICE && defined($op->[cTAG]) && length($op->[cTAG])) { + $op = bless explicit($op); + $op->[cTYPE] = opSEQUENCE; + } if ( @{$op->[cCHILD]} > 1) { ;#if ($op->[cTYPE] != opSEQUENCE) { @@ -897,7 +900,7 @@ 1; -# 947 "y.tab.pl" +# 950 "y.tab.pl" %yystate = ('State20','','State11','','State30','','State21','','State31', '','State50','','State32','','State14','','State51','','State33','', |