aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/core_lint.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-02-03 02:48:04 +0100
committerAnthony Ramine <[email protected]>2013-02-03 12:31:07 +0100
commit8784fdc88e32979ee2186500735ff4ada6190e15 (patch)
treeb160e62428ec5604d0f48fc291b40b918d8b7470 /lib/compiler/src/core_lint.erl
parent68b804f34d4ec420d86953e3f519179a40fbee8f (diff)
downloadotp-8784fdc88e32979ee2186500735ff4ada6190e15.tar.gz
otp-8784fdc88e32979ee2186500735ff4ada6190e15.tar.bz2
otp-8784fdc88e32979ee2186500735ff4ada6190e15.zip
Forbid multiple values in Core Erlang sequence arguments
It does not make sense to return multiple values from a sequence argument and the Kernel Erlang passes can't cope with it. The linting pass now knows how to detect this kind of defunct code and the Core code folding pass is changed to not generate code like that when optimizing away multiple-valued lets in effect mode. Reported-by: José Valim
Diffstat (limited to 'lib/compiler/src/core_lint.erl')
-rw-r--r--lib/compiler/src/core_lint.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/src/core_lint.erl b/lib/compiler/src/core_lint.erl
index 8b688df830..1e8983f594 100644
--- a/lib/compiler/src/core_lint.erl
+++ b/lib/compiler/src/core_lint.erl
@@ -309,7 +309,7 @@ expr(#c_fun{vars=Vs,body=B}, Def, Rt, St0) ->
{Vvs,St1} = variable_list(Vs, St0),
return_match(Rt, 1, body(B, union(Vvs, Def), any, St1));
expr(#c_seq{arg=Arg,body=B}, Def, Rt, St0) ->
- St1 = expr(Arg, Def, any, St0), %Ignore values
+ St1 = expr(Arg, Def, 1, St0),
body(B, Def, Rt, St1);
expr(#c_let{vars=Vs,arg=Arg,body=B}, Def, Rt, St0) ->
St1 = body(Arg, Def, let_varcount(Vs), St0), %This is a body