aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-06-26 15:06:32 +0200
committerFredrik Gustafsson <[email protected]>2013-06-26 15:06:32 +0200
commit7afffe3cd1e5fa3f9a45f8f78b44639be35ffd4c (patch)
tree59b3ae010f822230326857c4bbd05e7787a05a9a /lib/compiler/src
parent3c5dc983ac2e6069b1c87310acd84140f590a3da (diff)
parenta39fc3aae94d2f95bf02c46bac9b441c6fa57f62 (diff)
downloadotp-7afffe3cd1e5fa3f9a45f8f78b44639be35ffd4c.tar.gz
otp-7afffe3cd1e5fa3f9a45f8f78b44639be35ffd4c.tar.bz2
otp-7afffe3cd1e5fa3f9a45f8f78b44639be35ffd4c.zip
Merge branch 'nox/illegal-bitstring-gen-pattern/OTP-11186'
* nox/illegal-bitstring-gen-pattern/OTP-11186: Bootstrap added Simplify v3_core's translation of bit string generators Forbid unsized fields in patterns of binary generators
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/v3_core.erl19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index d6fdcb2b21..8159b42f2f 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -1133,28 +1133,13 @@ bc_tq1(_, {bin,Bl,Elements}, [], AccVar, St0) ->
%%Anno = Anno0#a{anno=[compiler_generated|A]},
{set_anno(E, Anno),Pre,St}.
-append_tail_segment(Segs, St) ->
- app_tail_seg(Segs, St, []).
-
-app_tail_seg([#c_bitstr{val=Var0,size=#c_literal{val=all}}=Seg0]=L,
- St0, Acc) ->
- case Var0 of
- #c_var{name='_'} ->
- {Var,St} = new_var(St0),
- Seg = Seg0#c_bitstr{val=Var},
- {reverse(Acc, [Seg]),Var,St};
- #c_var{} ->
- {reverse(Acc, L),Var0,St0}
- end;
-app_tail_seg([H|T], St, Acc) ->
- app_tail_seg(T, St, [H|Acc]);
-app_tail_seg([], St0, Acc) ->
+append_tail_segment(Segs, St0) ->
{Var,St} = new_var(St0),
Tail = #c_bitstr{val=Var,size=#c_literal{val=all},
unit=#c_literal{val=1},
type=#c_literal{val=binary},
flags=#c_literal{val=[unsigned,big]}},
- {reverse(Acc, [Tail]),Var,St}.
+ {Segs++[Tail],Var,St}.
emasculate_segments(Segs, St) ->
emasculate_segments(Segs, St, []).