aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-03-24 14:40:24 +0100
committerAnthony Ramine <[email protected]>2013-03-28 09:18:01 +0100
commit57d5d8450811eb7c79b1365ab13fec689f8decdd (patch)
treef70ab870e453b8611f4f5ed5516a547a799f061e /lib/compiler/test
parentf285ee66678ae8761dc82b5ba0c023dd759091fc (diff)
downloadotp-57d5d8450811eb7c79b1365ab13fec689f8decdd.tar.gz
otp-57d5d8450811eb7c79b1365ab13fec689f8decdd.tar.bz2
otp-57d5d8450811eb7c79b1365ab13fec689f8decdd.zip
Fix optimization of some binary comprehensions
If a variable bound in a generator is used as the size of a segment in the comprehension body, v3_core uses this variable in the code generated to compute the initial size given to the `bs_init_writable` primop before the variable is actually bound, as in: << <<0:S>> || S <- Slist >> Reported-By: Peer Stritzinger
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/bs_bincomp_SUITE.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl
index d39e340429..451a9b1e3b 100644
--- a/lib/compiler/test/bs_bincomp_SUITE.erl
+++ b/lib/compiler/test/bs_bincomp_SUITE.erl
@@ -282,6 +282,9 @@ sizes(Config) when is_list(Config) ->
?line <<1,2,3,0>> = Fun13(7),
?line <<1,2,3,0,0>> = Fun13(8),
+ <<0:3>> = cs_default(<< <<0:S>> || S <- [0,1,2] >>),
+ <<0:3>> = cs_default(<< <<0:S>> || <<S>> <= <<0,1,2>> >>),
+
?line {'EXIT',_} = (catch << <<C:4>> || <<C:8>> <= {1,2,3} >>),
?line cs_end(),