Skip to content

Commit

Permalink
Fix loss of state in code_server
Browse files Browse the repository at this point in the history
We were accidentally returning the old closed
over state, which lead to loss of information,
causing the code_server to crash.

This was introduced in #7503.
  • Loading branch information
josevalim authored Jan 24, 2024
1 parent 17e1746 commit 805cb0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kernel/src/code_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1132,11 +1132,11 @@ try_finish_module(File, Mod, PC, EnsureLoaded, From, St) ->
fun(_, S0) ->
case erlang:module_loaded(Mod) of
true ->
reply_loading(EnsureLoaded, Mod, {module, Mod}, St);
reply_loading(EnsureLoaded, Mod, {module, Mod}, S0);
false when S0#state.mode =:= interactive ->
try_finish_module_1(File, Mod, PC, From, EnsureLoaded, S0);
false ->
reply_loading(EnsureLoaded, Mod, {error, embedded}, St)
reply_loading(EnsureLoaded, Mod, {error, embedded}, S0)
end
end
end,
Expand Down

0 comments on commit 805cb0d

Please sign in to comment.