diff options
author | Björn Gustavsson <[email protected]> | 2013-01-10 11:03:04 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-01-10 11:03:04 +0100 |
commit | d07defaadc038455d3122bc7fdf2523efd2a9841 (patch) | |
tree | 48e39757174531eaea6361178ca330c592bca9c8 /lib/asn1/src/asn1rt_uper_bin.erl | |
parent | 4cd517c8168b2bdf7b38544e91afc14b535b3989 (diff) | |
parent | a12301def60aa2c20f25eaad1299089de3375063 (diff) | |
download | otp-d07defaadc038455d3122bc7fdf2523efd2a9841.tar.gz otp-d07defaadc038455d3122bc7fdf2523efd2a9841.tar.bz2 otp-d07defaadc038455d3122bc7fdf2523efd2a9841.zip |
Merge branch 'bjorn/asn1/minor-fixes'
* bjorn/asn1/minor-fixes: (21 commits)
Always inline decoding of open types
Eliminate code duplication
per: Slightly optimize encoding of fixed OCTET STRINGs
per: Fix encoding of OCTET STRINGs with fixed length of 256 or more
Remove support for the {Typename,Value} notation in encoding
asn1ct_parser2: Let synonyms share parsing code
Add a test case for constraint equivalence
Make .abs file consultable
Fix a bug in skipping of extensions
asn1rt_uper_bin: Correct incorrect skipping of extensions
asn1 doc: Remove a reference to a section that has been removed
Simplify testConstraints by introducing helper functions
Simplify testCompactBitString by introducing roundtrip functions
Simplify testEnumExt by introducing a roundtrip/2 function
Simplify testChoExternal by introducing a roundtrip/2 function
Simplify testChoRecursive by introducing a roundtrip/2 function
Simplify testSeqExtension.erl by introducing a roundtrip/2 function
Simplify testChoExtension by introducing a roundtrip/2 function
Simplify testSetOptional by introducing a roundtrip/2 function
testSetOptional: Correct test case for decoding of corrupt data
...
Diffstat (limited to 'lib/asn1/src/asn1rt_uper_bin.erl')
-rw-r--r-- | lib/asn1/src/asn1rt_uper_bin.erl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/asn1/src/asn1rt_uper_bin.erl b/lib/asn1/src/asn1rt_uper_bin.erl index 9410c3ef90..fc65d80245 100644 --- a/lib/asn1/src/asn1rt_uper_bin.erl +++ b/lib/asn1/src/asn1rt_uper_bin.erl @@ -120,14 +120,15 @@ fixextensions(Pos,ExtPos,Val,Acc) -> end, fixextensions(Pos+1,ExtPos,Val,(Acc bsl 1)+Bit). -skipextensions(Bytes,Nr,ExtensionBitPattern) -> - case (catch element(Nr,ExtensionBitPattern)) of - 1 -> +skipextensions(Bytes,Nr,ExtensionBitstr) when is_bitstring(ExtensionBitstr) -> + Prev = Nr - 1, + case ExtensionBitstr of + <<_:Prev,1:1,_/bitstring>> -> {_,Bytes2} = decode_open_type(Bytes,[]), - skipextensions(Bytes2, Nr+1, ExtensionBitPattern); - 0 -> - skipextensions(Bytes, Nr+1, ExtensionBitPattern); - {'EXIT',_} -> % badarg, no more extensions + skipextensions(Bytes2, Nr+1, ExtensionBitstr); + <<_:Prev,0:1,_/bitstring>> -> + skipextensions(Bytes, Nr+1, ExtensionBitstr); + _ -> Bytes end. |