aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asn1')
-rw-r--r--lib/asn1/doc/src/notes.xml25
-rw-r--r--lib/asn1/src/asn1ct.erl115
-rw-r--r--lib/asn1/src/asn1ct_check.erl125
-rw-r--r--lib/asn1/src/asn1ct_gen.erl8
-rw-r--r--lib/asn1/src/asn1rt_driver_handler.erl5
-rw-r--r--lib/asn1/vsn.mk2
6 files changed, 172 insertions, 108 deletions
diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml
index 375e859d20..c93adeffe2 100644
--- a/lib/asn1/doc/src/notes.xml
+++ b/lib/asn1/doc/src/notes.xml
@@ -31,6 +31,31 @@
<p>This document describes the changes made to the asn1 application.</p>
+<section><title>Asn1 1.6.15</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The encoding of ExtensionAdditionGroup (for PER and UPER)
+ is corrected.</p>
+ <p>
+ Own Id: OTP-8866 Aux Id: OTP-8797, SEQ-11557 </p>
+ </item>
+ <item>
+ <p>
+ A race condition when several processes in parallel start
+ to do encode/decode using the driver could cause an error
+ log regarding crashing port owner process. This race is
+ now eliminated.</p>
+ <p>
+ Own Id: OTP-8948 Aux Id: seq11733 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Asn1 1.6.14.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl
index fb2614aa2c..947578f07d 100644
--- a/lib/asn1/src/asn1ct.erl
+++ b/lib/asn1/src/asn1ct.erl
@@ -39,7 +39,7 @@
add_tobe_refed_func/1,add_generated_refed_func/1,
maybe_rename_function/3,latest_sindex/0,current_sindex/0,
set_current_sindex/1,next_sindex/0,maybe_saved_sindex/2,
- parse_and_save/2,report_verbose/3]).
+ parse_and_save/2,verbose/3,warning/3,error/3]).
-include("asn1_records.hrl").
-include_lib("stdlib/include/erl_compile.hrl").
@@ -103,8 +103,8 @@ compile(File,Options) when is_list(Options) ->
compile1(File,Options) when is_list(Options) ->
- report_verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,File],Options),
- report_verbose("Compiler Options: ~p~n",[Options],Options),
+ verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,File],Options),
+ verbose("Compiler Options: ~p~n",[Options],Options),
Ext = filename:extension(File),
Base = filename:basename(File,Ext),
OutFile = outfile(Base,"",Options),
@@ -152,14 +152,14 @@ inline(true,Name,Module,Options) ->
IgorName = list_to_atom(filename:rootname(filename:basename(Name))),
% io:format("*****~nName: ~p~nModules: ~p~nIgorOptions: ~p~n*****~n",
% [IgorName,Modules++RTmodule,IgorOptions]),
- report_verbose("Inlining modules: ~p in ~p~n",[[Module]++RTmodule,IgorName],Options),
+ verbose("Inlining modules: ~p in ~p~n",[[Module]++RTmodule,IgorName],Options),
case catch igor:merge(IgorName,[Module]++RTmodule,[{preprocess,true},{stubs,false},{backups,false}]++IgorOptions) of
{'EXIT',{undef,Reason}} -> %% module igor first in R10B
- io:format("Module igor in syntax_tools must be available:~n~p~n",
- [Reason]),
+ error("Module igor in syntax_tools must be available:~n~p~n",
+ [Reason],Options),
{error,'no_compilation'};
{'EXIT',Reason} ->
- io:format("Merge by igor module failed due to ~p~n",[Reason]),
+ error("Merge by igor module failed due to ~p~n",[Reason],Options),
{error,'no_compilation'};
_ ->
%% io:format("compiling output module: ~p~n",[generated_file(Name,IgorOptions)]),
@@ -173,8 +173,8 @@ inline(_,_,_,_) ->
compile_set(SetBase,Files,Options)
when is_list(hd(Files)),is_list(Options) ->
%% case when there are several input files in a list
- report_verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,Files],Options),
- report_verbose("Compiler Options: ~p~n",[Options],Options),
+ verbose("Erlang ASN.1 version ~p compiling ~p ~n",[?vsn,Files],Options),
+ verbose("Compiler Options: ~p~n",[Options],Options),
OutFile = outfile(SetBase,"",Options),
DbFile = outfile(SetBase,"asn1db",Options),
Includes = [I || {i,I} <- Options],
@@ -728,7 +728,7 @@ parse_set(ScanRes,Options) ->
scan(File,Options) ->
case asn1ct_tok:file(File) of
{error,Reason} ->
- io:format("~p~n",[Reason]),
+ error("~p~n",[Reason],Options),
{false,{error,Reason}};
Tokens ->
case lists:member(ss,Options) of
@@ -753,16 +753,17 @@ parse({true,Tokens},File,Options) ->
if
is_integer(Line) ->
BaseName = filename:basename(File),
- io:format("syntax error at line ~p in module ~s:~n",
- [Line,BaseName]);
+ error("syntax error at line ~p in module ~s:~n",
+ [Line,BaseName],Options);
true ->
- io:format("syntax error in module ~p:~n",[File])
+ error("syntax error in module ~p:~n",
+ [File],Options)
end,
print_error_message(Message),
{false,{error,Message}};
{error,{Line,_Mod,[Message,Token]}} ->
- io:format("syntax error: ~p ~p at line ~p~n",
- [Message,Token,Line]),
+ error("syntax error: ~p ~p at line ~p~n",
+ [Message,Token,Line],Options),
{false,{error,{Line,[Message,Token]}}};
{ok,M} ->
case lists:member(sp,Options) of
@@ -772,7 +773,7 @@ parse({true,Tokens},File,Options) ->
{true,M}
end;
OtherError ->
- io:format("~p~n",[OtherError])
+ error("~p~n",[OtherError],Options)
end;
parse({false,Tokens},_,_) ->
{false,Tokens}.
@@ -802,7 +803,7 @@ check({true,M},File,OutFile,Includes,EncodingRule,DbFile,Options,InputMods) ->
NewM = Module#module{typeorval=NewTypeOrVal},
asn1_db:dbput(NewM#module.name,'MODULE',NewM),
asn1_db:dbsave(DbFile,M#module.name),
- report_verbose("--~p--~n",[{generated,DbFile}],Options),
+ verbose("--~p--~n",[{generated,DbFile}],Options),
{true,{M,NewM,GenTypeOrVal}}
end
end;
@@ -823,11 +824,11 @@ generate({true,{M,_Module,GenTOrV}},OutFile,EncodingRule,Options) ->
% io:format("Options: ~p~n",[Options]),
case catch specialized_decode_prepare(EncodingRule,M,GenTOrV,Options) of
{error, enoent} -> ok;
- {error, Reason} -> io:format("WARNING: Error in configuration"
- "file: ~n~p~n",[Reason]);
- {'EXIT',Reason} -> io:format("WARNING: Internal error when "
- "analyzing configuration"
- "file: ~n~p~n",[Reason]);
+ {error, Reason} -> warning("Error in configuration "
+ "file: ~n~p~n",[Reason],Options);
+ {'EXIT',Reason} -> warning("Internal error when "
+ "analyzing configuration "
+ "file: ~n~p~n",[Reason],Options);
_ -> ok
end,
@@ -835,7 +836,7 @@ generate({true,{M,_Module,GenTOrV}},OutFile,EncodingRule,Options) ->
case (catch asn1ct_gen:pgen(OutFile,EncodingRule,
M#module.name,GenTOrV,Options)) of
{'EXIT',Reason2} ->
- io:format("ERROR: ~p~n",[Reason2]),
+ error("~p~n",[Reason2],Options),
{error,Reason2};
_ ->
ok
@@ -878,7 +879,8 @@ parse_and_save(Module,S) ->
_ -> ok
end;
Err ->
- io:format("Warning: could not do a consistency check of the ~p file: no asn1 source file was found.~n",[lists:concat([Module,".asn1db"])]),
+ warning("could not do a consistency check of the ~p file: no asn1 source file was found.~n",
+ [lists:concat([Module,".asn1db"])],Options),
{error,{asn1,input_file_error,Err}}
end.
parse_and_save1(S,File,Options,Includes) ->
@@ -1208,7 +1210,7 @@ compile_py(File,OutFile,Options) ->
compile(File, _OutFile, Options) ->
case catch compile(File, make_erl_options(Options)) of
Exit = {'EXIT',_Reason} ->
- io:format("~p~n~s~n",[Exit,"error"]),
+ error("~p~n~s~n",[Exit,"error"],Options),
error;
{error,_Reason} ->
%% case occurs due to error in asn1ct_parser2,asn1ct_check
@@ -1224,7 +1226,7 @@ compile(File, _OutFile, Options) ->
io:format("~p~n",[ScanRes]),
ok;
Unknown ->
- io:format("~p~n~s~n",[Unknown,"error"]),
+ error("~p~n~s~n",[Unknown,"error"],Options),
error
end.
@@ -1238,7 +1240,7 @@ make_erl_options(Opts) ->
Includes = Opts#options.includes,
Defines = Opts#options.defines,
Outdir = Opts#options.outdir,
-%% Warning = Opts#options.warning,
+ Warning = Opts#options.warning,
Verbose = Opts#options.verbose,
Specific = Opts#options.specific,
Optimize = Opts#options.optimize,
@@ -1250,10 +1252,10 @@ make_erl_options(Opts) ->
true -> [verbose];
false -> []
end ++
-%%% case Warning of
-%%% 0 -> [];
-%%% _ -> [report_warnings]
-%%% end ++
+ case Warning of
+ 0 -> [];
+ _ -> [warnings]
+ end ++
[] ++
case Optimize of
1 -> [optimize];
@@ -1277,7 +1279,7 @@ make_erl_options(Opts) ->
uper_bin -> [uper_bin]
end,
- Options++[report_errors, {cwd, Cwd}, {outdir, Outdir}|
+ Options++[errors, {cwd, Cwd}, {outdir, Outdir}|
lists:map(fun(Dir) -> {i, Dir} end, Includes)]++Specific.
pretty2(Module,AbsFile) ->
@@ -2519,13 +2521,48 @@ type_check(#'Externaltypereference'{}) ->
make_suffix(_) ->
"".
-report_verbose(Format, Args, S) ->
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Report functions.
+%%
+%% Errors messages are controlled with the 'errors' compiler option
+%% Warning messages are controlled with the 'warnings' compiler option
+%% Verbose messages are controlled with the 'verbose' compiler option
+
+error(Format, Args, S) ->
+ case is_error(S) of
+ true ->
+ io:format("Error: " ++ Format, Args);
+ false ->
+ ok
+ end.
+
+warning(Format, Args, S) ->
+ case is_warning(S) of
+ true ->
+ io:format("Warning: " ++ Format, Args);
+ false ->
+ ok
+ end.
+
+verbose(Format, Args, S) ->
case is_verbose(S) of
- true ->
- io:format(Format, Args);
- false ->
- ok
+ true ->
+ io:format(Format, Args);
+ false ->
+ ok
end.
-is_verbose(S) ->
- lists:member(verbose, S).
+is_error(S) when is_record(S, state) ->
+ is_error(S#state.options);
+is_error(O) ->
+ lists:member(errors, O) orelse is_verbose(O).
+
+is_warning(S) when is_record(S, state) ->
+ is_warning(S#state.options);
+is_warning(O) ->
+ lists:member(warnings, O) orelse is_verbose(O).
+
+is_verbose(S) when is_record(S, state) ->
+ is_verbose(S#state.options);
+is_verbose(O) ->
+ lists:member(verbose, O).
diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl
index c6f3b60786..8b1ee6e601 100644
--- a/lib/asn1/src/asn1ct_check.erl
+++ b/lib/asn1/src/asn1ct_check.erl
@@ -2029,8 +2029,9 @@ get_objectset_def2(_S,Set,CField) when is_list(Set) ->
set=Set}};
get_objectset_def2(_S,T = #typedef{typespec=#'ObjectSet'{}},_CField) ->
T;
-get_objectset_def2(_S,T,_CField) ->
- io:format("Warning get_objectset_def2: uncontrolled object set structure:~n~p~n",[T]).
+get_objectset_def2(S,T,_CField) ->
+ asn1ct:warning("get_objectset_def2: uncontrolled object set structure:~n~p~n",
+ [T],S).
type_name(S,#type{def=Def}) ->
CurrMod = S#state.mname,
@@ -2687,7 +2688,7 @@ normalize_value(S,Type,{'DEFAULT',Value},NameList) ->
{'REAL',_,_} ->
normalize_real(Value);
{'ENUMERATED',CType,_} ->
- normalize_enumerated(Value,CType);
+ normalize_enumerated(S,Value,CType);
{'CHOICE',CType,NewNameList} ->
normalize_choice(S,Value,CType,NewNameList);
{'SEQUENCE',CType,NewNameList} ->
@@ -2703,7 +2704,8 @@ normalize_value(S,Type,{'DEFAULT',Value},NameList) ->
{'ASN1_OPEN_TYPE',{typefield,_TF},NL} -> %an open type
normalize_objectclassfieldvalue(S,Value,NL);
Err ->
- io:format("WARNING: could not check default value ~p~nType:~n~p~nNameList:~n~p~n",[Value,Type,Err]),
+ asn1ct:warning("could not check default value ~p~nType:~n~p~nNameList:~n~p~n",
+ [Value,Type,Err],S),
Value
end;
normalize_value(S,Type,Val,NameList) ->
@@ -2788,23 +2790,23 @@ normalize_bitstring(S,Value,Type)->
end,
case catch lists:map(F,RecList) of
{error,Reason} ->
- io:format("WARNING: default value not "
+ asn1ct:warning("default value not "
"compatible with type definition ~p~n",
- [Reason]),
+ [Reason],S),
Value;
NewList ->
NewList
end;
_ ->
- io:format("WARNING: default value not "
+ asn1ct:warning("default value not "
"compatible with type definition ~p~n",
- [RecList]),
+ [RecList],S),
Value
end;
{Name,String} when is_atom(Name) ->
normalize_bitstring(S,String,Type);
Other ->
- io:format("WARNING: illegal default value ~p~n",[Other]),
+ asn1ct:warning("illegal default value ~p~n",[Other],S),
Value
end.
@@ -2843,12 +2845,13 @@ normalize_octetstring(S,Value,CType) ->
%% check if list elements are valid octet values
lists:map(fun([])-> ok;
(H)when H > 255->
- io:format("WARNING: not legal octet value ~p in OCTET STRING, ~p~n",[H,List]);
+ asn1ct:warning("not legal octet value ~p in OCTET STRING, ~p~n",
+ [H,List],S);
(_)-> ok
end, List),
List;
Other ->
- io:format("WARNING: unknown default value ~p~n",[Other]),
+ asn1ct:warning("unknown default value ~p~n",[Other],S),
Value
end.
@@ -2895,23 +2898,23 @@ normalize_objectdescriptor(Value) ->
normalize_real(Value) ->
Value.
-normalize_enumerated(#'Externalvaluereference'{value=V},CType)
+normalize_enumerated(S,#'Externalvaluereference'{value=V},CType)
when is_list(CType) ->
- normalize_enumerated2(V,CType);
-normalize_enumerated(Value,CType) when is_atom(Value),is_list(CType) ->
- normalize_enumerated2(Value,CType);
-normalize_enumerated({Name,EnumV},CType) when is_atom(Name) ->
- normalize_enumerated(EnumV,CType);
-normalize_enumerated(Value,{CType1,CType2}) when is_list(CType1), is_list(CType2)->
- normalize_enumerated(Value,CType1++CType2);
-normalize_enumerated(V,CType) ->
- io:format("WARNING: Enumerated unknown type ~p~n",[CType]),
+ normalize_enumerated2(S,V,CType);
+normalize_enumerated(S,Value,CType) when is_atom(Value),is_list(CType) ->
+ normalize_enumerated2(S,Value,CType);
+normalize_enumerated(S,{Name,EnumV},CType) when is_atom(Name) ->
+ normalize_enumerated(S,EnumV,CType);
+normalize_enumerated(S,Value,{CType1,CType2}) when is_list(CType1), is_list(CType2)->
+ normalize_enumerated(S,Value,CType1++CType2);
+normalize_enumerated(S,V,CType) ->
+ asn1ct:warning("Enumerated unknown type ~p~n",[CType],S),
V.
-normalize_enumerated2(V,Enum) ->
+normalize_enumerated2(S,V,Enum) ->
case lists:keysearch(V,1,Enum) of
{value,{Val,_}} -> Val;
_ ->
- io:format("WARNING: Enumerated value is not correct ~p~n",[V]),
+ asn1ct:warning("Enumerated value is not correct ~p~n",[V],S),
V
end.
@@ -2922,8 +2925,7 @@ normalize_choice(S,{'CHOICE',{C,V}},CType,NameList) when is_atom(C) ->
{C,normalize_value(S,CT,{'DEFAULT',V},
[Name|NameList])};
Other ->
- io:format("WARNING: Wrong format of type/value ~p/~p~n",
- [Other,V]),
+ asn1ct:warning("Wrong format of type/value ~p/~p~n",[Other,V],S),
{C,V}
end;
normalize_choice(S,{'DEFAULT',ValueList},CType,NameList) when is_list(ValueList) ->
@@ -3099,8 +3101,7 @@ normalize_s_of(SorS,S,Value,Type,NameList) when is_list(Value) ->
List when is_list(List) ->
List;
_ ->
- io:format("WARNING: ~p could not handle value ~p~n",
- [SorS,Value]),
+ asn1ct:warning("~p could not handle value ~p~n",[SorS,Value],S),
Value
end;
normalize_s_of(SorS,S,Value,Type,NameList)
@@ -3152,15 +3153,13 @@ get_normalized_value(S,Val,Type,Func,AddArg) ->
V2 = sort_val_if_set(AddArg,V,Type),
call_Func(update_state(S,ExtM),V2,Type,Func,AddArg);
{error,_} ->
- io:format("WARNING: default value not "
- "comparable ~p~n",[Val]),
+ asn1ct:warning("default value not comparable ~p~n",[Val],S),
Val;
{ExtM,NewVal} ->
V2 = sort_val_if_set(AddArg,NewVal,Type),
call_Func(update_state(S,ExtM),V2,Type,Func,AddArg);
_ ->
- io:format("WARNING: default value not "
- "comparable ~p~n",[Val]),
+ asn1ct:warning("default value not comparable ~p~n",[Val],S),
Val
end.
@@ -4109,7 +4108,7 @@ resolve_namednumber(S,#typedef{typespec=Type},Name) ->
case Type#type.def of
{'ENUMERATED',NameList} ->
NamedNumberList=check_enumerated(S,NameList,Type#type.constraint),
- N = normalize_enumerated(Name,NamedNumberList),
+ N = normalize_enumerated(S,Name,NamedNumberList),
{value,{_,V}} = lists:keysearch(N,1,NamedNumberList),
V;
{'INTEGER',NameList} ->
@@ -5710,9 +5709,9 @@ sort_components(der,S=#state{tname=TypeName},Components) ->
end,
case {untagged_choice(S,CompsList),Ext} of
{false,noext} ->
- {true,sort_components1(TypeName,CompsList,[],[],[],[])};
+ {true,sort_components1(S,TypeName,CompsList,[],[],[],[])};
{false,_} ->
- {true,{sort_components1(TypeName,CompsList,[],[],[],[]), []}};
+ {true,{sort_components1(S,TypeName,CompsList,[],[],[],[]), []}};
{true,noext} ->
%% sort in run-time
{dynamic,R1};
@@ -5724,57 +5723,57 @@ sort_components(per,S=#state{tname=TypeName},Components) ->
Root = tag_untagged_choice(S,R1++R2),
case Ext of
noext ->
- {true,sort_components1(TypeName,Root,[],[],[],[])};
+ {true,sort_components1(S,TypeName,Root,[],[],[],[])};
_ ->
- {true,{sort_components1(TypeName,Root,[],[],[],[]),
+ {true,{sort_components1(S,TypeName,Root,[],[],[],[]),
Ext}}
end.
-sort_components1(TypeName,[C=#'ComponentType'{tags=[{'UNIVERSAL',_}|_R]}|Cs],
+sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'UNIVERSAL',_}|_R]}|Cs],
UnivAcc,ApplAcc,ContAcc,PrivAcc) ->
- sort_components1(TypeName,Cs,[C|UnivAcc],ApplAcc,ContAcc,PrivAcc);
-sort_components1(TypeName,[C=#'ComponentType'{tags=[{'APPLICATION',_}|_R]}|Cs],
+ sort_components1(S,TypeName,Cs,[C|UnivAcc],ApplAcc,ContAcc,PrivAcc);
+sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'APPLICATION',_}|_R]}|Cs],
UnivAcc,ApplAcc,ContAcc,PrivAcc) ->
- sort_components1(TypeName,Cs,UnivAcc,[C|ApplAcc],ContAcc,PrivAcc);
-sort_components1(TypeName,[C=#'ComponentType'{tags=[{'CONTEXT',_}|_R]}|Cs],
+ sort_components1(S,TypeName,Cs,UnivAcc,[C|ApplAcc],ContAcc,PrivAcc);
+sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'CONTEXT',_}|_R]}|Cs],
UnivAcc,ApplAcc,ContAcc,PrivAcc) ->
- sort_components1(TypeName,Cs,UnivAcc,ApplAcc,[C|ContAcc],PrivAcc);
-sort_components1(TypeName,[C=#'ComponentType'{tags=[{'PRIVATE',_}|_R]}|Cs],
+ sort_components1(S,TypeName,Cs,UnivAcc,ApplAcc,[C|ContAcc],PrivAcc);
+sort_components1(S,TypeName,[C=#'ComponentType'{tags=[{'PRIVATE',_}|_R]}|Cs],
UnivAcc,ApplAcc,ContAcc,PrivAcc) ->
- sort_components1(TypeName,Cs,UnivAcc,ApplAcc,ContAcc,[C|PrivAcc]);
-sort_components1(TypeName,[],UnivAcc,ApplAcc,ContAcc,PrivAcc) ->
+ sort_components1(S,TypeName,Cs,UnivAcc,ApplAcc,ContAcc,[C|PrivAcc]);
+sort_components1(S,TypeName,[],UnivAcc,ApplAcc,ContAcc,PrivAcc) ->
I = #'ComponentType'.tags,
- ascending_order_check(TypeName,sort_universal_type(UnivAcc)) ++
- ascending_order_check(TypeName,lists:keysort(I,ApplAcc)) ++
- ascending_order_check(TypeName,lists:keysort(I,ContAcc)) ++
- ascending_order_check(TypeName,lists:keysort(I,PrivAcc)).
+ ascending_order_check(S,TypeName,sort_universal_type(UnivAcc)) ++
+ ascending_order_check(S,TypeName,lists:keysort(I,ApplAcc)) ++
+ ascending_order_check(S,TypeName,lists:keysort(I,ContAcc)) ++
+ ascending_order_check(S,TypeName,lists:keysort(I,PrivAcc)).
-ascending_order_check(TypeName,Components) ->
- ascending_order_check1(TypeName,Components),
+ascending_order_check(S,TypeName,Components) ->
+ ascending_order_check1(S,TypeName,Components),
Components.
-ascending_order_check1(TypeName,
+ascending_order_check1(S,TypeName,
[C1 = #'ComponentType'{tags=[{_,T}|_]},
C2 = #'ComponentType'{tags=[{_,T}|_]}|Rest]) ->
- io:format("WARNING: Indistinct tag ~p in SET ~p, components ~p and ~p~n",
- [T,TypeName,C1#'ComponentType'.name,C2#'ComponentType'.name]),
- ascending_order_check1(TypeName,[C2|Rest]);
-ascending_order_check1(TypeName,
+ asn1ct:warning("Indistinct tag ~p in SET ~p, components ~p and ~p~n",
+ [T,TypeName,C1#'ComponentType'.name,C2#'ComponentType'.name],S),
+ ascending_order_check1(S,TypeName,[C2|Rest]);
+ascending_order_check1(S,TypeName,
[C1 = #'ComponentType'{tags=[{'UNIVERSAL',T1}|_]},
C2 = #'ComponentType'{tags=[{'UNIVERSAL',T2}|_]}|Rest]) ->
case (decode_type(T1) == decode_type(T2)) of
true ->
- io:format("WARNING: Indistinct tags ~p and ~p in"
+ asn1ct:warning("Indistinct tags ~p and ~p in"
" SET ~p, components ~p and ~p~n",
[T1,T2,TypeName,C1#'ComponentType'.name,
- C2#'ComponentType'.name]),
- ascending_order_check1(TypeName,[C2|Rest]);
+ C2#'ComponentType'.name],S),
+ ascending_order_check1(S,TypeName,[C2|Rest]);
_ ->
- ascending_order_check1(TypeName,[C2|Rest])
+ ascending_order_check1(S,TypeName,[C2|Rest])
end;
-ascending_order_check1(N,[_|Rest]) ->
- ascending_order_check1(N,Rest);
-ascending_order_check1(_,[]) ->
+ascending_order_check1(S,N,[_|Rest]) ->
+ ascending_order_check1(S,N,Rest);
+ascending_order_check1(_,_,[]) ->
ok.
sort_universal_type(Components) ->
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 0bb0b65e5d..0844c38353 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -87,7 +87,7 @@ pgen_module(OutFile,Erules,Module,
% gen_vars(asn1_db:mod_to_vars(Module)),
% gen_tag_table(AllTypes),
file:close(Fid),
- asn1ct:report_verbose("--~p--~n",[{generated,ErlFile}],Options).
+ asn1ct:verbose("--~p--~n",[{generated,ErlFile}],Options).
pgen_typeorval(Erules,Module,N2nConvEnums,{Types,Values,_Ptypes,_Classes,Objects,ObjectSets}) ->
@@ -1340,9 +1340,9 @@ pgen_hrl(Erules,Module,TypeOrVal,Options,_Indent) ->
Y ->
Fid = get(gen_file_out),
file:close(Fid),
- asn1ct:report_verbose("--~p--~n",
- [{generated,lists:concat([get(outfile),".hrl"])}],
- Options),
+ asn1ct:verbose("--~p--~n",
+ [{generated,lists:concat([get(outfile),".hrl"])}],
+ Options),
Y
end.
diff --git a/lib/asn1/src/asn1rt_driver_handler.erl b/lib/asn1/src/asn1rt_driver_handler.erl
index c95b243ae0..cc2b501e16 100644
--- a/lib/asn1/src/asn1rt_driver_handler.erl
+++ b/lib/asn1/src/asn1rt_driver_handler.erl
@@ -71,7 +71,10 @@ load_driver(Reason) ->
end.
init(FromPid,FromRef) ->
- register(asn1_driver_owner,self()),
+ case catch register(asn1_driver_owner,self()) of
+ true -> true;
+ _Other -> exit(normal)
+ end,
Dir = filename:join([code:priv_dir(asn1),"lib"]),
case catch erl_ddll:load_driver(Dir,asn1_erl_drv) of
ok ->
diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk
index 0399ff2732..e900a52286 100644
--- a/lib/asn1/vsn.mk
+++ b/lib/asn1/vsn.mk
@@ -1,2 +1,2 @@
#next version number to use is 1.6.15 | 1.7 | 2.0
-ASN1_VSN = 1.6.14.1
+ASN1_VSN = 1.6.15