diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl index b4ed66d72f08..d052c4e31bdc 100644 --- a/lib/asn1/src/asn1ct.erl +++ b/lib/asn1/src/asn1ct.erl @@ -1606,6 +1606,8 @@ exclusive_dec_command(_, TNL, _) -> throw({error,{"unexpected error when creating partial " "decode command",TNL}}). +exclusive_dec_choice_comps(_, [], Acc) -> + lists:reverse(Acc); exclusive_dec_choice_comps([#'ComponentType'{name=C,typespec=TS}|Comps], [{C,Directive}|Rest], Acc) -> case Directive of @@ -1617,20 +1619,18 @@ exclusive_dec_choice_comps([#'ComponentType'{name=C,typespec=TS}|Comps], [Command,Tag] when is_atom(Command) -> [[Command,Tag,CompAcc]|Acc] end, - exclusive_dec_command({'CHOICE',Comps}, Rest, NewAcc); + exclusive_dec_choice_comps(Comps, Rest, NewAcc); undecoded -> TagCommand = get_tag_command(TS, ?ALTERNATIVE_UNDECODED, mandatory), - exclusive_dec_command({'CHOICE',Comps}, Rest, [TagCommand|Acc]); + exclusive_dec_choice_comps(Comps, Rest, [TagCommand|Acc]); parts -> TagCommand = get_tag_command(TS, ?ALTERNATIVE_PARTS, mandatory), - exclusive_dec_command({'CHOICE',Comps}, Rest, [TagCommand|Acc]) + exclusive_dec_choice_comps(Comps, Rest, [TagCommand|Acc]) end; exclusive_dec_choice_comps([#'ComponentType'{typespec=TS}|Cs], TNL, Acc) -> TagCommand = get_tag_command(TS, ?ALTERNATIVE, mandatory), - exclusive_dec_choice_comps(Cs, TNL, [TagCommand|Acc]); -exclusive_dec_choice_comps(_, [], Acc) -> - lists:reverse(Acc). + exclusive_dec_choice_comps(Cs, TNL, [TagCommand|Acc]). partial_inc_dec_toptype([T|_]) when is_atom(T) -> T;