aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/icode/hipe_icode_range.erl
diff options
context:
space:
mode:
authorZandra <[email protected]>2016-02-02 11:24:51 +0100
committerZandra <[email protected]>2016-02-02 11:24:51 +0100
commit61ef7511c5ffae0b061d7cc45e9d564b02b891db (patch)
treea658adcfc0006d1a79f4bc36ce5f6efc8ccceedf /lib/hipe/icode/hipe_icode_range.erl
parent7cb403e4aa044fd2cc7702dbe8e2d0eea68e81f3 (diff)
parent34380bad4985bc827866129597e0bea940e076f4 (diff)
downloadotp-61ef7511c5ffae0b061d7cc45e9d564b02b891db.tar.gz
otp-61ef7511c5ffae0b061d7cc45e9d564b02b891db.tar.bz2
otp-61ef7511c5ffae0b061d7cc45e9d564b02b891db.zip
Merge branch 'margnus1/bs_unit_fix' into maint
* margnus1/bs_unit_fix: hipe: Fix signed compares of unsigned sizes beam: Fix overflow bug in i_bs_add_jId hipe: Add tests for bad bit syntax float sizes Add a case testing the handling of guards involving binaries Add some more binary syntax construction tests hipe: Guard against enormous numbers in ranges hipe: Fix constructing huge binaries hipe: Fix binary constructions failing with badarith Add missing corner-case to bs_construct_SUITE hipe: Allow unsigned args in hipe_rtl_arith hipe: test unit size match in bs_put_binary_all hipe: test unit size match in bs_append Fix hipe_rtl_binary_construct:floorlog2/1 OTP-13272
Diffstat (limited to 'lib/hipe/icode/hipe_icode_range.erl')
-rw-r--r--lib/hipe/icode/hipe_icode_range.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl
index ba5fa1bfd7..9a20527a83 100644
--- a/lib/hipe/icode/hipe_icode_range.erl
+++ b/lib/hipe/icode/hipe_icode_range.erl
@@ -1202,11 +1202,11 @@ basic_type(#unsafe_update_element{}) -> not_analysed.
analyse_bs_get_integer(Size, Flags, true) ->
Signed = Flags band 4,
if Signed =:= 0 ->
- Max = 1 bsl Size - 1,
+ Max = inf_add(inf_bsl(1, Size), -1),
Min = 0;
true ->
- Max = 1 bsl (Size-1) - 1,
- Min = -(1 bsl (Size-1))
+ Max = inf_add(inf_bsl(1, Size-1), -1),
+ Min = inf_inv(inf_bsl(1, Size-1))
end,
{Min, Max};
analyse_bs_get_integer(Size, Flags, false) when is_integer(Size),