@@ -59,13 +59,21 @@ eval_forms(Forms, Line, Vars, S) ->
59
59
60
60
% % Pass { native, false } to speed up bootstrap
61
61
% % process when native is set to true
62
- { module (Form , S # elixir_scope .file , [{native ,false }], true , fun (_ , _ ) ->
62
+ { module (Form , S # elixir_scope .file , [{native ,false }], true , fun (_ , Binary ) ->
63
63
Res = Module :Fun (S # elixir_scope .module , Args ),
64
64
code :delete (Module ),
65
- case code :soft_purge (Module ) of
66
- true -> return_module_name (I );
67
- false -> ok
65
+
66
+ % % If we have labeled locals, anonymous functions
67
+ % % were created and therefore we cannot ditch the
68
+ % % module
69
+ case beam_lib :chunks (Binary , [labeled_locals ]) of
70
+ { ok , { _ , [{ labeled_locals , []}] } } ->
71
+ code :purge (Module ),
72
+ return_module_name (I );
73
+ _ ->
74
+ ok
68
75
end ,
76
+
69
77
Res
70
78
end ), FS }.
71
79
@@ -162,7 +170,7 @@ core_main() ->
162
170
" lib/elixir/lib/kernel.ex" ,
163
171
" lib/elixir/lib/keyword.ex" ,
164
172
" lib/elixir/lib/list.ex" ,
165
- " lib/elixir/lib/kernel/typespec.ex" ,
173
+ " lib/elixir/lib/kernel/typespec.ex" ,
166
174
" lib/elixir/lib/module.ex" ,
167
175
" lib/elixir/lib/record.ex" ,
168
176
" lib/elixir/lib/record/extractor.ex" ,
0 commit comments