aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-12-30 15:47:34 +0100
committerBjörn Gustavsson <[email protected]>2012-01-11 08:39:57 +0100
commit70630b0d1e8216bb0d59ae3c66b99ae5df7367b5 (patch)
tree170632471c68db729a06e57828e5f2ab3d1a1116
parent734f0ce999a174ea1e469c265c6847e91cf0c4cd (diff)
downloadotp-70630b0d1e8216bb0d59ae3c66b99ae5df7367b5.tar.gz
otp-70630b0d1e8216bb0d59ae3c66b99ae5df7367b5.tar.bz2
otp-70630b0d1e8216bb0d59ae3c66b99ae5df7367b5.zip
v3_kernel: Removed unreached clause for #k_bin_int{} in sub_size_var/1
The size field of a #k_bin_int{} is always a literal integer (#k_int{}); thus there is no way this clause can match. While we are at it, remove a duplicated call to select_assert_match_possible/3 in select_bin_int/1.
-rw-r--r--lib/compiler/src/v3_kernel.erl3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl
index 43325f4125..de568eef25 100644
--- a/lib/compiler/src/v3_kernel.erl
+++ b/lib/compiler/src/v3_kernel.erl
@@ -1112,7 +1112,6 @@ select_bin_int([#iclause{pats=[#k_bin_seg{anno=A,type=integer,
end,
select_assert_match_possible(Bits, Val, Fl),
P = #k_bin_int{anno=A,size=Sz,unit=U,flags=Fl,val=Val,next=N},
- select_assert_match_possible(Bits, Val, Fl),
case member(native, Fl) of
true -> throw(not_possible);
false -> ok
@@ -1254,8 +1253,6 @@ match_clause([U|Us], [C|_]=Cs0, Def, St0) ->
sub_size_var(#k_bin_seg{size=#k_var{name=Name}=Kvar}=BinSeg, [#iclause{isub=Sub}|_]) ->
BinSeg#k_bin_seg{size=Kvar#k_var{name=get_vsub(Name, Sub)}};
-sub_size_var(#k_bin_int{size=#k_var{name=Name}=Kvar}=BinSeg, [#iclause{isub=Sub}|_]) ->
- BinSeg#k_bin_int{size=Kvar#k_var{name=get_vsub(Name, Sub)}};
sub_size_var(K, _) -> K.
get_con([C|_]) -> arg_arg(clause_arg(C)). %Get the constructor