aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-08-17 06:49:22 +0200
committerBjörn Gustavsson <[email protected]>2017-08-23 05:57:38 +0200
commitcbeeed095739223a425649f6085b6959ad905c83 (patch)
treeed58bc08a28edf53172656d36acb528a014b348d /erts/emulator/test
parent7f7905f653170daf8a185636329701486fec4ad8 (diff)
downloadotp-cbeeed095739223a425649f6085b6959ad905c83.tar.gz
otp-cbeeed095739223a425649f6085b6959ad905c83.tar.bz2
otp-cbeeed095739223a425649f6085b6959ad905c83.zip
beam_makeops: Introduce the new type 'W' (machine word)
As a preparation for potentially improving packing in the future, we will need to make sure that packable types have a defined maximum size. The packer algorithm assumes that two 'I' operands can be packed into one 64-bit word, but there are instructions that use an 'I' operand to store a pointer. It only works because those instructions are not packed for other reasons. Introduce the 'W' type and use it for operands that don't fit in 32 bits.
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/tuple_SUITE.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/test/tuple_SUITE.erl b/erts/emulator/test/tuple_SUITE.erl
index 79b681b4d1..baf41180e0 100644
--- a/erts/emulator/test/tuple_SUITE.erl
+++ b/erts/emulator/test/tuple_SUITE.erl
@@ -134,6 +134,13 @@ t_element(Config) when is_list(Config) ->
{'EXIT', {badarg, _}} = (catch element(1, id(42))),
{'EXIT', {badarg, _}} = (catch element(id(1.5), id({a,b}))),
+ %% Make sure that the loader does not reject the module when
+ %% huge literal index values are used.
+ {'EXIT', {badarg, _}} = (catch element((1 bsl 24)-1, id({a,b,c}))),
+ {'EXIT', {badarg, _}} = (catch element(1 bsl 24, id({a,b,c}))),
+ {'EXIT', {badarg, _}} = (catch element(1 bsl 32, id({a,b,c}))),
+ {'EXIT', {badarg, _}} = (catch element(1 bsl 64, id({a,b,c}))),
+
ok.
get_elements([Element|Rest], Tuple, Pos) ->