diff options
author | Sverker Eriksson <[email protected]> | 2016-06-01 16:22:09 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-06-01 19:41:29 +0200 |
commit | 58d52b1d2d3e9f14bda5b9248d9b25ae12535548 (patch) | |
tree | c8732c330d4a9045bdb34ed8884fa2d01cc21584 /erts/emulator | |
parent | f4bdac18cb9dd45185e911308a5ebd95ff10d7fd (diff) | |
download | otp-58d52b1d2d3e9f14bda5b9248d9b25ae12535548.tar.gz otp-58d52b1d2d3e9f14bda5b9248d9b25ae12535548.tar.bz2 otp-58d52b1d2d3e9f14bda5b9248d9b25ae12535548.zip |
erts: Avoid literals in process independent ErlNifEnv
that would go undetected and cause havoc if module is purged.
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/erl_nif.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index f1c35cd5a5..4fd82bad10 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -803,19 +803,13 @@ ERL_NIF_TERM enif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term) { Uint sz; Eterm* hp; -#ifdef SHCOPY - erts_shcopy_t info; - INITIALIZE_SHCOPY(info); - sz = copy_shared_calculate(src_term, &info); - hp = alloc_heap(dst_env, sz); - src_term = copy_shared_perform(src_term, sz, &info, &hp, &MSO(dst_env->proc)); - DESTROY_SHCOPY(info); - return src_term; -#else + /* + * No preserved sharing allowed as long as literals are also preserved. + * Process independent environment can not be reached by purge. + */ sz = size_object(src_term); hp = alloc_heap(dst_env, sz); return copy_struct(src_term, sz, &hp, &MSO(dst_env->proc)); -#endif } |