aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/code_server.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-09-25 17:03:02 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-11-17 16:07:55 +0100
commit1391715d8bbba315e1509e60e6245159a009bd9b (patch)
tree0afa756ee9ed8bb0d88c441533cb778fe08e1b13 /lib/kernel/src/code_server.erl
parent8f8aa9c5c4e26e563c935e06f8346175fa15d876 (diff)
downloadotp-1391715d8bbba315e1509e60e6245159a009bd9b.tar.gz
otp-1391715d8bbba315e1509e60e6245159a009bd9b.tar.bz2
otp-1391715d8bbba315e1509e60e6245159a009bd9b.zip
Use copy literal range check in message passing and purging
Diffstat (limited to 'lib/kernel/src/code_server.erl')
-rw-r--r--lib/kernel/src/code_server.erl25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index e461c95d19..68dd21b1d7 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -1428,16 +1428,18 @@ absname_vr([[X, $:]|Name], _, _AbsBase) ->
do_purge(Mod0) ->
Mod = to_atom(Mod0),
case erlang:check_old_code(Mod) of
- false ->
- false;
- true ->
- Res = check_proc_code(erlang:processes(), Mod, true),
- try
- erlang:purge_module(Mod)
- catch
- _:_ -> ignore
- end,
- Res
+ false ->
+ false;
+ true ->
+ true = erlang:copy_literals(Mod, true),
+ Res = check_proc_code(erlang:processes(), Mod, true),
+ true = erlang:copy_literals(Mod, false),
+ try
+ erlang:purge_module(Mod)
+ catch
+ _:_ -> ignore
+ end,
+ Res
end.
%% do_soft_purge(Module)
@@ -1451,10 +1453,13 @@ do_soft_purge(Mod0) ->
false ->
true;
true ->
+ true = erlang:copy_literals(Mod, true),
case check_proc_code(erlang:processes(), Mod, false) of
false ->
+ true = erlang:copy_literals(Mod, false),
false;
true ->
+ true = erlang:copy_literals(Mod, false),
try
erlang:purge_module(Mod)
catch