aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test
diff options
context:
space:
mode:
authorSteve Vinoski <[email protected]>2015-04-30 15:46:52 -0400
committerSteve Vinoski <[email protected]>2015-05-26 11:13:16 -0400
commit2f38cce79ae1bf318cdc8884bd74d1407778d91d (patch)
treea9c576fb36558ffb6e1876ac7ca71b7097aa86e3 /erts/emulator/test
parent50cdb87765cd46e0a809d97f62df28baf8a2c16a (diff)
downloadotp-2f38cce79ae1bf318cdc8884bd74d1407778d91d.tar.gz
otp-2f38cce79ae1bf318cdc8884bd74d1407778d91d.tar.bz2
otp-2f38cce79ae1bf318cdc8884bd74d1407778d91d.zip
Fix for enif_schedule_nif and exceptions
Fix a place where part of the implementation of enif_schedule_nif was not using the ErlNifEnv exception_thrown field when it should have been. Also make the result of enif_schedule_nif return false when passed to enif_is_exception, and add an assertion for this to the nif_SUITE.c tests.
Diffstat (limited to 'erts/emulator/test')
-rw-r--r--erts/emulator/test/nif_SUITE_data/nif_SUITE.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
index 3cc9f51ef8..58d9a9a88c 100644
--- a/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
+++ b/erts/emulator/test/nif_SUITE_data/nif_SUITE.c
@@ -1536,9 +1536,12 @@ static ERL_NIF_TERM nif_sched1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv
static ERL_NIF_TERM call_nif_schedule(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
+ ERL_NIF_TERM result;
if (argc != 2)
return enif_make_atom(env, "false");
- return enif_schedule_nif(env, "nif_sched1", 0, nif_sched1, argc, argv);
+ result = enif_schedule_nif(env, "nif_sched1", 0, nif_sched1, argc, argv);
+ assert(!enif_is_exception(env, result));
+ return result;
}
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT