aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/icode/hipe_beam_to_icode.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2015-10-23 17:09:16 +0200
committerMagnus Lång <[email protected]>2015-11-27 18:18:38 +0100
commit148153eb16e873181ff6961f854105a240989265 (patch)
tree307202287cc27ab559e18675667a9a508a0e4559 /lib/hipe/icode/hipe_beam_to_icode.erl
parentfd21382290333e6cc25728c1b6dd7c211ddfc297 (diff)
downloadotp-148153eb16e873181ff6961f854105a240989265.tar.gz
otp-148153eb16e873181ff6961f854105a240989265.tar.bz2
otp-148153eb16e873181ff6961f854105a240989265.zip
hipe: test unit size match in bs_put_binary_all
The unit size field was previously completely discarded when lowering this instruction from BEAM to Icode. This feature was previously missing and expressions such as <<0, <<1:1>>/binary>> would succeed construction when compiled with HiPE.
Diffstat (limited to 'lib/hipe/icode/hipe_beam_to_icode.erl')
-rw-r--r--lib/hipe/icode/hipe_beam_to_icode.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl
index 0c7bdb788a..6aba48e0c1 100644
--- a/lib/hipe/icode/hipe_beam_to_icode.erl
+++ b/lib/hipe/icode/hipe_beam_to_icode.erl
@@ -1306,7 +1306,7 @@ trans_bin([{bs_put_binary,{f,Lbl},Size,Unit,{field_flags,Flags},Source}|
{Name, Args, Env2} =
case Size of
{atom,all} -> %% put all bits
- {{bs_put_binary_all, Flags}, [Src,Base,Offset], Env};
+ {{bs_put_binary_all, Unit, Flags}, [Src,Base,Offset], Env};
{integer,NoBits} when is_integer(NoBits), NoBits >= 0 ->
%% Create a N*Unit bits subbinary
{{bs_put_binary, NoBits*Unit, Flags}, [Src,Base,Offset], Env};