summaryrefslogtreecommitdiff
path: root/lib/stdlib/src/erl_lint.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r--lib/stdlib/src/erl_lint.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 0cd0aef124..d6cb57e392 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -3371,9 +3371,11 @@ handle_comprehension(E, Qs, Vt0, St0) ->
Vt3 = vtmerge(vtsubtract(Vt2, Uvt), Uvt),
%% Don't export local variables.
Vt4 = vtold(Vt3, Vt0),
- %% Forget about old variables which were not used.
- Vt5 = vt_no_unused(Vt4),
- {Vt5,St}.
+ %% Forget about old variables which were not used as well as unsafe
+ %% variables, preventing them from being marked as used and bound by
+ %% icrt_export/4.
+ Vt = vt_no_unsafe(vt_no_unused(Vt4)),
+ {Vt, St}.
%% lc_quals(Qualifiers, ImportVarTable, State) ->
%% {VarTable,ShadowedVarTable,State}