aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-02-06 16:55:49 +0100
committerFredrik Gustafsson <[email protected]>2013-02-06 16:55:49 +0100
commit205a535dc9750d3ed1e930b1dd8a1c4084f5f46f (patch)
treefbaca513bbc3d7ac6a933bfb39b7fdbf73582737 /lib/compiler/src
parentf21d6280bd52b2c97f231f8b853daffc204790b8 (diff)
parent5773a7861a1888c8ae6e6f17ca847b121820f248 (diff)
downloadotp-205a535dc9750d3ed1e930b1dd8a1c4084f5f46f.tar.gz
otp-205a535dc9750d3ed1e930b1dd8a1c4084f5f46f.tar.bz2
otp-205a535dc9750d3ed1e930b1dd8a1c4084f5f46f.zip
Merge branch 'nox/fix-seq-opt/OTP-10818'
* nox/fix-seq-opt/OTP-10818: Add two tests for unused multiple values in effect context Forbid multiple values in Core Erlang sequence arguments
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/core_lint.erl2
-rw-r--r--lib/compiler/src/sys_core_fold.erl7
2 files changed, 7 insertions, 2 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
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index 07b054c5d7..cda3f7d81e 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -132,7 +132,12 @@ body(Body, Sub) ->
body(#c_values{anno=A,es=Es0}, Ctxt, Sub) ->
Es1 = expr_list(Es0, Ctxt, Sub),
- #c_values{anno=A,es=Es1};
+ case Ctxt of
+ value ->
+ #c_values{anno=A,es=Es1};
+ effect ->
+ make_effect_seq(Es1, Sub)
+ end;
body(E, Ctxt, Sub) ->
?ASSERT(verify_scope(E, Sub)),
expr(E, Ctxt, Sub).