From: Graham B. <gb...@us...> - 2002-03-25 09:06:20
|
Update of /cvsroot/perl-ldap/asn/lib/Convert/ASN1 In directory usw-pr-cvs1:/tmp/cvs-serv20416/lib/Convert/ASN1 Modified Files: _decode.pm Log Message: Patch from Wolfgang Laun Fix bug in decode when there are nested CHOICEs Add tests t/10choice.t t/11indef.t Index: _decode.pm =================================================================== RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/_decode.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- _decode.pm 25 Mar 2002 07:46:08 -0000 1.14 +++ _decode.pm 25 Mar 2002 09:06:16 -0000 1.15 @@ -163,6 +163,36 @@ next OP; } + unless (length $cop->[cTAG]) { + eval { + _decode( + $optn, + [$cop], + (\my %tmp_stash), + $pos, + $npos+$len+$indef, + undef, + $indef ? $larr : [], + $buf, + ); + + my $nstash = $seqof + ? ($seqof->[$idx++]={}) + : defined($var) + ? ($stash->{$var}={}) + : ref($stash) eq 'SCALAR' + ? ($$stash={}) : $stash; + + @{$nstash}{keys %tmp_stash} = values %tmp_stash; + + } or next; + + $pos = $npos+$len+$indef; + + redo CHOICELOOP if $seqof && $pos < $end; + next OP; + } + if ($tag eq ($cop->[cTAG] | chr(ASN_CONSTRUCTOR)) and my $ctr = $ctr[$cop->[cTYPE]]) { |