aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/map_SUITE.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-03-25 19:06:22 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-25 19:08:09 +0100
commit2d95280094fa6429081a9b9df3c73705819e2461 (patch)
tree31512de294088d7ba0b2ce30fcd04f19d84b4e17 /lib/compiler/test/map_SUITE.erl
parent71df02b2ead5c68eb9c4dff00d91a1d0e94659fe (diff)
downloadotp-2d95280094fa6429081a9b9df3c73705819e2461.tar.gz
otp-2d95280094fa6429081a9b9df3c73705819e2461.tar.bz2
otp-2d95280094fa6429081a9b9df3c73705819e2461.zip
compiler: Do not evaluate map expressions with bad keys
Map keys with large (non literal) binary keys must fail.
Diffstat (limited to 'lib/compiler/test/map_SUITE.erl')
-rw-r--r--lib/compiler/test/map_SUITE.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index f1383297ef..cc018e4305 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -122,6 +122,7 @@ t_build_and_match_literals(Config) when is_list(Config) ->
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id({a,b,c}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id(#{y=>3}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id(#{x=>"three"}))),
+ {'EXIT',{badarg,_}} = (catch id(#{<<0:258>> =>"three"})),
ok.
t_build_and_match_aliasing(Config) when is_list(Config) ->
@@ -239,7 +240,7 @@ t_update_assoc(Config) when is_list(Config) ->
BadMap = id(badmap),
{'EXIT',{badarg,_}} = (catch BadMap#{nonexisting=>val}),
{'EXIT',{badarg,_}} = (catch <<>>#{nonexisting=>val}),
-
+ {'EXIT',{badarg,_}} = (catch M0#{<<0:257>> => val}), %% limitation
ok.
t_update_exact(Config) when is_list(Config) ->
@@ -268,6 +269,7 @@ t_update_exact(Config) when is_list(Config) ->
{'EXIT',{badarg,_}} = (catch M0#{42.0:=v,42:=v2}),
{'EXIT',{badarg,_}} = (catch M0#{42=>v1,42.0:=v2,42:=v3}),
{'EXIT',{badarg,_}} = (catch <<>>#{nonexisting:=val}),
+ {'EXIT',{badarg,_}} = (catch M0#{<<0:257>> := val}), %% limitation
ok.
t_update_values(Config) when is_list(Config) ->