aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/compiler/src/v3_core.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl
index 3f33dbca52..2da24b2908 100644
--- a/lib/compiler/src/v3_core.erl
+++ b/lib/compiler/src/v3_core.erl
@@ -1118,6 +1118,16 @@ bc_tq1(_, {bin,Bl,Elements}, [], AccVar, St0) ->
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) ->