From b602ed02a44e2cb6eec2d8e79f723cf607138934 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Tue, 7 Jul 2015 11:02:15 +0200 Subject: Export shell:catch_exception/1 as documented --- lib/stdlib/src/shell.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl index c64123a207..f215a66812 100644 --- a/lib/stdlib/src/shell.erl +++ b/lib/stdlib/src/shell.erl @@ -23,7 +23,7 @@ -export([whereis_evaluator/0, whereis_evaluator/1]). -export([start_restricted/1, stop_restricted/0]). -export([local_allowed/3, non_local_allowed/3]). --export([prompt_func/1, strings/1]). +-export([catch_exception/1, prompt_func/1, strings/1]). -define(LINEMAX, 30). -define(CHAR_MAX, 60). -- cgit v1.2.3 From 2e61f98dd41ce7328aebc27debd78845afdc0dba Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Fri, 31 Jul 2015 21:15:13 +0200 Subject: erts: fix binary_to_integer boundary case erlang:binary_to_integer/1 and /2 fail to detect invalid input consisting of a single + or - sign but nothing else. For an input like <<"+">> they return 0, while list_to_integer/1 correctly signals a badarg for "+". Fixed by checking if the input is empty after the initial +/- sign processing. Added a test case which fails without this fix but passes with it. Thanks to "niku" for reporting the issue. --- erts/emulator/beam/big.c | 3 +++ erts/emulator/test/num_bif_SUITE.erl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erts/emulator/beam/big.c b/erts/emulator/beam/big.c index 044bf6a34e..15bcd44fb9 100644 --- a/erts/emulator/beam/big.c +++ b/erts/emulator/beam/big.c @@ -2618,6 +2618,9 @@ Eterm erts_chars_to_integer(Process *BIF_P, char *bytes, size--; } + if (size == 0) + goto bytebuf_to_integer_1_error; + if (size < SMALL_DIGITS && base <= 10) { /* * * Take shortcut if we know that all chars are '0' < b < '9' and diff --git a/erts/emulator/test/num_bif_SUITE.erl b/erts/emulator/test/num_bif_SUITE.erl index f07f79b83d..90b6a36262 100644 --- a/erts/emulator/test/num_bif_SUITE.erl +++ b/erts/emulator/test/num_bif_SUITE.erl @@ -429,7 +429,7 @@ t_string_to_integer(Config) when is_list(Config) -> list_to_binary(Value))), {'EXIT', {badarg, _}} = (catch erlang:list_to_integer(Value)) - end,["1.0"," 1"," -1",""]), + end,["1.0"," 1"," -1","","+"]), % Custom base error cases lists:foreach(fun({Value,Base}) -> -- cgit v1.2.3 From 1497898b7d680de86d64bdec133003288adee820 Mon Sep 17 00:00:00 2001 From: Daniel Goertzen Date: Tue, 11 Aug 2015 12:02:50 -0500 Subject: fix unused parameter warning in enif_make_pid --- erts/emulator/beam/erl_nif_api_funcs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/erl_nif_api_funcs.h b/erts/emulator/beam/erl_nif_api_funcs.h index f93152c921..2f2180e1aa 100644 --- a/erts/emulator/beam/erl_nif_api_funcs.h +++ b/erts/emulator/beam/erl_nif_api_funcs.h @@ -543,7 +543,7 @@ static ERL_NIF_INLINE ERL_NIF_TERM enif_make_list9(ErlNifEnv* env, #ifndef enif_make_pid -# define enif_make_pid(ENV, PID) ((const ERL_NIF_TERM)((PID)->pid)) +# define enif_make_pid(ENV, PID) ((void)(ENV),(const ERL_NIF_TERM)((PID)->pid)) #if SIZEOF_LONG == 8 # define enif_get_int64 enif_get_long -- cgit v1.2.3 From b37793a7b42114816ee8c0dc86217253c7e74781 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Fri, 11 Sep 2015 10:28:41 +0200 Subject: Exclude ose application from upgrade test --- erts/test/upgrade_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/test/upgrade_SUITE.erl b/erts/test/upgrade_SUITE.erl index 8a91cf5b7e..83cd2359d8 100644 --- a/erts/test/upgrade_SUITE.erl +++ b/erts/test/upgrade_SUITE.erl @@ -40,7 +40,7 @@ %% - typer requires hipe (in the .app file) %% - erl_interface, jinterface support no upgrade -define(appup_exclude, - [dialyzer,hipe,typer,erl_interface,jinterface]). + [dialyzer,hipe,typer,erl_interface,jinterface,ose]). init_per_suite(Config) -> %% Check that a real release is running, not e.g. cerl -- cgit v1.2.3