diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2016-04-25 08:17:12 +0200 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2016-04-25 08:17:12 +0200 |
commit | bac22c4f6218900a029baf39bc6419c9cea7aa9d (patch) | |
tree | b02ea09c2fead3b5e5613815288592e2d6f5c157 | |
parent | a8527fac1e63f7b01dcd54f010adacdfb5816b82 (diff) | |
download | otp-bac22c4f6218900a029baf39bc6419c9cea7aa9d.tar.gz otp-bac22c4f6218900a029baf39bc6419c9cea7aa9d.tar.bz2 otp-bac22c4f6218900a029baf39bc6419c9cea7aa9d.zip |
Update primary bootstrap
-rw-r--r-- | bootstrap/lib/compiler/ebin/cerl.beam | bin | 31940 -> 32008 bytes | |||
-rw-r--r-- | bootstrap/lib/compiler/ebin/cerl_trees.beam | bin | 20676 -> 20908 bytes | |||
-rw-r--r-- | bootstrap/lib/compiler/ebin/core_parse.beam | bin | 50888 -> 57124 bytes | |||
-rw-r--r-- | bootstrap/lib/compiler/ebin/core_pp.beam | bin | 13144 -> 13336 bytes | |||
-rw-r--r-- | bootstrap/lib/compiler/ebin/v3_core.beam | bin | 53720 -> 53716 bytes | |||
-rw-r--r-- | bootstrap/lib/stdlib/ebin/erl_lint.beam | bin | 89744 -> 89676 bytes | |||
-rw-r--r-- | bootstrap/lib/stdlib/include/assert.hrl | 29 |
7 files changed, 18 insertions, 11 deletions
diff --git a/bootstrap/lib/compiler/ebin/cerl.beam b/bootstrap/lib/compiler/ebin/cerl.beam Binary files differindex 88857b8905..1fea28a4dc 100644 --- a/bootstrap/lib/compiler/ebin/cerl.beam +++ b/bootstrap/lib/compiler/ebin/cerl.beam diff --git a/bootstrap/lib/compiler/ebin/cerl_trees.beam b/bootstrap/lib/compiler/ebin/cerl_trees.beam Binary files differindex 37120929ba..a2c27861c4 100644 --- a/bootstrap/lib/compiler/ebin/cerl_trees.beam +++ b/bootstrap/lib/compiler/ebin/cerl_trees.beam diff --git a/bootstrap/lib/compiler/ebin/core_parse.beam b/bootstrap/lib/compiler/ebin/core_parse.beam Binary files differindex 9860250dbb..baf2c9d70f 100644 --- a/bootstrap/lib/compiler/ebin/core_parse.beam +++ b/bootstrap/lib/compiler/ebin/core_parse.beam diff --git a/bootstrap/lib/compiler/ebin/core_pp.beam b/bootstrap/lib/compiler/ebin/core_pp.beam Binary files differindex ddf504dfd2..8f97709248 100644 --- a/bootstrap/lib/compiler/ebin/core_pp.beam +++ b/bootstrap/lib/compiler/ebin/core_pp.beam diff --git a/bootstrap/lib/compiler/ebin/v3_core.beam b/bootstrap/lib/compiler/ebin/v3_core.beam Binary files differindex 4d4087948d..9b2450089a 100644 --- a/bootstrap/lib/compiler/ebin/v3_core.beam +++ b/bootstrap/lib/compiler/ebin/v3_core.beam diff --git a/bootstrap/lib/stdlib/ebin/erl_lint.beam b/bootstrap/lib/stdlib/ebin/erl_lint.beam Binary files differindex c4c3323013..22d3607866 100644 --- a/bootstrap/lib/stdlib/ebin/erl_lint.beam +++ b/bootstrap/lib/stdlib/ebin/erl_lint.beam diff --git a/bootstrap/lib/stdlib/include/assert.hrl b/bootstrap/lib/stdlib/include/assert.hrl index 151794d114..9e5d4eb598 100644 --- a/bootstrap/lib/stdlib/include/assert.hrl +++ b/bootstrap/lib/stdlib/include/assert.hrl @@ -59,19 +59,22 @@ -define(assert(BoolExpr),ok). -else. %% The assert macro is written the way it is so as not to cause warnings -%% for clauses that cannot match, even if the expression is a constant. +%% for clauses that cannot match, even if the expression is a constant or +%% is known to be boolean-only. -define(assert(BoolExpr), begin ((fun () -> + __T = is_process_alive(self()), % cheap source of truth case (BoolExpr) of - true -> ok; + __T -> ok; __V -> erlang:error({assert, [{module, ?MODULE}, {line, ?LINE}, {expression, (??BoolExpr)}, {expected, true}, - case __V of false -> {value, __V}; - _ -> {not_boolean,__V} + case not __T of + __V -> {value, false}; + _ -> {not_boolean, __V} end]}) end end)()) @@ -85,15 +88,17 @@ -define(assertNot(BoolExpr), begin ((fun () -> + __F = not is_process_alive(self()), case (BoolExpr) of - false -> ok; + __F -> ok; __V -> erlang:error({assert, [{module, ?MODULE}, {line, ?LINE}, {expression, (??BoolExpr)}, {expected, false}, - case __V of true -> {value, __V}; - _ -> {not_boolean,__V} + case not __F of + __V -> {value, true}; + _ -> {not_boolean, __V} end]}) end end)()) @@ -149,7 +154,8 @@ -else. -define(assertEqual(Expect, Expr), begin - ((fun (__X) -> + ((fun () -> + __X = (Expect), case (Expr) of __X -> ok; __V -> erlang:error({assertEqual, @@ -159,7 +165,7 @@ {expected, __X}, {value, __V}]}) end - end)(Expect)) + end)()) end). -endif. @@ -169,7 +175,8 @@ -else. -define(assertNotEqual(Unexpected, Expr), begin - ((fun (__X) -> + ((fun () -> + __X = (Unexpected), case (Expr) of __X -> erlang:error({assertNotEqual, [{module, ?MODULE}, @@ -178,7 +185,7 @@ {value, __X}]}); _ -> ok end - end)(Unexpected)) + end)()) end). -endif. |