From f149194f227fd593757ff2c750b82b62f9a6e8aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Wed, 19 Mar 2014 15:19:19 +0100 Subject: sasl: Fix crash in systools_make:format_error/1 The crash occurred when systools:make_script/2 raises the 'duplicate_modules' error. Depending on the 'silent' option, systools_make:format_error/1 is called to either format and display an error message, or return a tuple containing the error properties. When displaying a 'duplicate_modules' error message, format_error/1 receives a list of applications providing the same module(s): [ {{Mod,App1,_}, {Mod,App2,_}}, ... ] However, before this fix, format_error/1 expected the following structure, leading to a 'function_clause' exception: [ {{Mod,_,App1,_,_}, {Mod,_,App2,_,_}}, ... ] The crash never occurred with the 'silent' option, because the error and its properties are returned as is to the caller. --- lib/sasl/src/systools_make.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sasl/src') diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl index bab88552f9..daa65e32b7 100644 --- a/lib/sasl/src/systools_make.erl +++ b/lib/sasl/src/systools_make.erl @@ -2218,7 +2218,7 @@ format_error({undefined_applications,Apps}) -> io_lib:format("Undefined applications: ~p~n",[Apps]); format_error({duplicate_modules,Dups}) -> io_lib:format("Duplicated modules: ~n~ts", - [map(fun({{Mod,_,App1,_,_},{Mod,_,App2,_,_}}) -> + [map(fun({{Mod,App1,_},{Mod,App2,_}}) -> io_lib:format("\t~w specified in ~w and ~w~n", [Mod,App1,App2]) end, Dups)]); -- cgit v1.2.3