diff options
author | Zandra <[email protected]> | 2015-10-15 17:03:26 +0200 |
---|---|---|
committer | Zandra <[email protected]> | 2015-10-15 17:03:26 +0200 |
commit | 2a3781b127ccd4b2065eed77de03a8a9a418f1f7 (patch) | |
tree | 76ab71f741368a8c359e3045d6b477311f3c5923 /lib/hipe/rtl/hipe_rtl_binary_construct.erl | |
parent | 90fcd9fdc8defdc15bfa5630ac4ece501a810d20 (diff) | |
parent | d94a8ef6dc136dd2eedf3c3ad4bc053ca8fdd1b0 (diff) | |
download | otp-2a3781b127ccd4b2065eed77de03a8a9a418f1f7.tar.gz otp-2a3781b127ccd4b2065eed77de03a8a9a418f1f7.tar.bz2 otp-2a3781b127ccd4b2065eed77de03a8a9a418f1f7.zip |
Merge branch 'kostis/hipe-bs-construct-zero-size' into maint
* kostis/hipe-bs-construct-zero-size:
Fix edge case of Size = 0 in bs_put_integer
OTP-13048
Diffstat (limited to 'lib/hipe/rtl/hipe_rtl_binary_construct.erl')
-rw-r--r-- | lib/hipe/rtl/hipe_rtl_binary_construct.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/hipe/rtl/hipe_rtl_binary_construct.erl b/lib/hipe/rtl/hipe_rtl_binary_construct.erl index 40bd22aa8e..692bad7d96 100644 --- a/lib/hipe/rtl/hipe_rtl_binary_construct.erl +++ b/lib/hipe/rtl/hipe_rtl_binary_construct.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2009. All Rights Reserved. +%% Copyright Ericsson AB 2007-2015. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -1192,7 +1192,10 @@ copy_little_word(Base, Offset, NewOffset, Word) -> hipe_rtl:mk_store(Base, TmpOffset, Word, byte), hipe_rtl:mk_alu(NewOffset, Offset, 'add', hipe_rtl:mk_imm(32))]. -copy_offset_int_big(Base, Offset, NewOffset, Size, Tmp1) when is_integer(Size) -> +copy_offset_int_big(_Base, Offset, NewOffset, 0, _Tmp1) -> + [hipe_rtl:mk_move(NewOffset, Offset)]; +copy_offset_int_big(Base, Offset, NewOffset, Size, Tmp1) + when is_integer(Size), Size > 0 -> Tmp2 = hipe_rtl:mk_new_reg(), Tmp3 = hipe_rtl:mk_new_reg(), Tmp4 = hipe_rtl:mk_new_reg(), @@ -1203,7 +1206,7 @@ copy_offset_int_big(Base, Offset, NewOffset, Size, Tmp1) when is_integer(Size) - Tmp9 = hipe_rtl:mk_new_reg(), OldByte = hipe_rtl:mk_new_reg(), TmpOffset = hipe_rtl:mk_new_reg(), - BranchLbl = hipe_rtl:mk_new_label(), + BranchLbl = hipe_rtl:mk_new_label(), BodyLbl = hipe_rtl:mk_new_label(), EndLbl = hipe_rtl:mk_new_label(), NextLbl = hipe_rtl:mk_new_label(), |