aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/code_server.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-01-28 12:24:44 +0100
committerBjörn Gustavsson <[email protected]>2016-01-28 12:24:44 +0100
commitdf5be3657a7eca136632fddd3e11a5cc2d78a1d8 (patch)
treed3bc1b045d6bf131846f1012e7b0b6752861c087 /lib/kernel/src/code_server.erl
parent6301ceeb265f68b417bb2ce58312e34b9557a294 (diff)
parentd8161c3ad977c0e20c075ecf58d8ac5769637828 (diff)
downloadotp-df5be3657a7eca136632fddd3e11a5cc2d78a1d8.tar.gz
otp-df5be3657a7eca136632fddd3e11a5cc2d78a1d8.tar.bz2
otp-df5be3657a7eca136632fddd3e11a5cc2d78a1d8.zip
Merge branch 'maint'
* maint: Update documentation for code-loading functions code: Correct the types for error returns Eliminate run-time system crash in code:load_abs/1
Diffstat (limited to 'lib/kernel/src/code_server.erl')
-rw-r--r--lib/kernel/src/code_server.erl9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index 3fbbb98b94..e72f8fd1b9 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -278,7 +278,7 @@ handle_call(get_path, {_From,_Tag}, S) ->
{reply,S#state.path,S};
%% Messages to load, delete and purge modules/files.
-handle_call({load_abs,File,Mod}, Caller, S) ->
+handle_call({load_abs,File,Mod}, Caller, S) when is_atom(Mod) ->
case modp(File) of
false ->
{reply,{error,badarg},S};
@@ -1075,15 +1075,10 @@ modp(Atom) when is_atom(Atom) -> true;
modp(List) when is_list(List) -> int_list(List);
modp(_) -> false.
-load_abs(File, Mod0, Caller, St) ->
+load_abs(File, Mod, Caller, St) ->
Ext = objfile_extension(),
FileName0 = lists:concat([File, Ext]),
FileName = absname(FileName0),
- Mod = if Mod0 =:= [] ->
- list_to_atom(filename:basename(FileName0, Ext));
- true ->
- Mod0
- end,
case erl_prim_loader:get_file(FileName) of
{ok,Bin,_} ->
try_load_module(FileName, Mod, Bin, Caller, St);