aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2017-03-21 20:03:58 +0100
committerKostis Sagonas <[email protected]>2017-03-21 20:03:58 +0100
commite688b5dd0ef3437e6e99419ea9af1895b9747216 (patch)
tree20a0fb3f8418e6659e45ac2efc4ddc029a8d84d1 /lib/hipe
parenta748cafdc7063d9f181ba12088db6458793ced2f (diff)
downloadotp-e688b5dd0ef3437e6e99419ea9af1895b9747216.tar.gz
otp-e688b5dd0ef3437e6e99419ea9af1895b9747216.tar.bz2
otp-e688b5dd0ef3437e6e99419ea9af1895b9747216.zip
Fix alignment of byte-sized constants
Diffstat (limited to 'lib/hipe')
-rw-r--r--lib/hipe/misc/hipe_consttab.erl2
-rw-r--r--lib/hipe/misc/hipe_pack_constants.erl4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/hipe/misc/hipe_consttab.erl b/lib/hipe/misc/hipe_consttab.erl
index 226b20fa46..adffed720d 100644
--- a/lib/hipe/misc/hipe_consttab.erl
+++ b/lib/hipe/misc/hipe_consttab.erl
@@ -193,7 +193,7 @@ insert_block({ConstTab, RefToLabels, NextLabel}, ElementType, InitList) ->
ReferredLabels = get_labels(InitList, []),
NewRefTo = ReferredLabels ++ RefToLabels,
{NewTa, Id} = insert_const({ConstTab, NewRefTo, NextLabel},
- block, word_size(), false,
+ block, size_of(ElementType), false,
{ElementType,InitList}),
{insert_backrefs(NewTa, Id, ReferredLabels), Id}.
diff --git a/lib/hipe/misc/hipe_pack_constants.erl b/lib/hipe/misc/hipe_pack_constants.erl
index b54830dd57..43aae6eb60 100644
--- a/lib/hipe/misc/hipe_pack_constants.erl
+++ b/lib/hipe/misc/hipe_pack_constants.erl
@@ -64,8 +64,8 @@
-spec pack_constants([{mfa(),[_],hipe_consttab()}], ct_alignment()) ->
{ct_alignment(), non_neg_integer(), packed_const_map(), mfa_refs_map()}.
-pack_constants(Data, Align) ->
- pack_constants(Data, 0, Align, 0, [], []).
+pack_constants(Data, _Align) ->
+ pack_constants(Data, 0, 1, 0, [], []).
pack_constants([{MFA,_,ConstTab}|Rest], Size, Align, ConstNo, Acc, Refs) ->
Labels = hipe_consttab:labels(ConstTab),