aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorSteve Vinoski <[email protected]>2014-11-04 11:46:19 -0500
committerSteve Vinoski <[email protected]>2014-11-04 11:46:19 -0500
commit66a184c576d9262045194e95c752a50c74877802 (patch)
tree2eaf0ccb9b31054d68c1a98584445b93dcf6dba3 /erts/emulator/beam/erl_nif.c
parent487c3858450d27e6838eed19e55c21641d101908 (diff)
downloadotp-66a184c576d9262045194e95c752a50c74877802.tar.gz
otp-66a184c576d9262045194e95c752a50c74877802.tar.bz2
otp-66a184c576d9262045194e95c752a50c74877802.zip
Fix gc-related problem with dirty NIFs
Ensure that the return value from a dirty NIF call is made part of the GC rootset. Add a new regression test to nif_SUITE. Thanks to Daniel Goertzen for reporting the error and providing a test case, and to Sverker Eriksson for making test case reproducible and finding the fix.
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index ede5f335dc..adc3520ebb 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1646,6 +1646,7 @@ init_nif_sched_data(ErlNifEnv* env, NativeFunPtr direct_fp, NativeFunPtr indirec
ep->m = env->mod_nif;
ep->fp = indirect_fp;
proc->freason = TRAP;
+ proc->arity = argc;
return THE_NON_VALUE;
}