aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2014-03-08 01:49:13 +0100
committerAnthony Ramine <[email protected]>2014-03-08 01:58:39 +0100
commit3abbbeec85268f243b7c97f569ad4da40babd8c9 (patch)
tree40c26095020a3a75d7d5f19491bcd6f071ea2521 /lib/compiler/test
parent870737ab657433c5e8751255fe3c4d298202d142 (diff)
downloadotp-3abbbeec85268f243b7c97f569ad4da40babd8c9.tar.gz
otp-3abbbeec85268f243b7c97f569ad4da40babd8c9.tar.bz2
otp-3abbbeec85268f243b7c97f569ad4da40babd8c9.zip
Properly detect reused boolean values in beam_bool
The following code could crash the compiler: f(X = true) when X or true or X -> ok. Reported-by: Ulf Norell
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/andor_SUITE.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/test/andor_SUITE.erl b/lib/compiler/test/andor_SUITE.erl
index d79696df38..b5408ecd8f 100644
--- a/lib/compiler/test/andor_SUITE.erl
+++ b/lib/compiler/test/andor_SUITE.erl
@@ -171,6 +171,8 @@ t_and_or(Config) when is_list(Config) ->
false = ?GUARD(erlang:'not'(erlang:'and'(bar, True))),
false = ?GUARD(erlang:'not'(erlang:'not'(erlang:'and'(bar, True)))),
+ true = (fun (X = true) when X or true or X -> true end)(True),
+
ok.
t_andalso(Config) when is_list(Config) ->