diff options
author | Sverker Eriksson <[email protected]> | 2018-05-17 12:19:38 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-05-17 12:19:38 +0200 |
commit | 759af43a8213f6c0b39a76ae062a89b726cd4c25 (patch) | |
tree | 949a150dc6f6decf59c81eb68bf345dfd16f6b45 /erts/emulator/beam/erl_nif.c | |
parent | daf8172b510c319fab74f77e438eae3518812543 (diff) | |
parent | d7bacbc798d608f259eb2faaaf194cb9df323018 (diff) | |
download | otp-759af43a8213f6c0b39a76ae062a89b726cd4c25.tar.gz otp-759af43a8213f6c0b39a76ae062a89b726cd4c25.tar.bz2 otp-759af43a8213f6c0b39a76ae062a89b726cd4c25.zip |
Merge PR-1819 from sverker/enif_binary_to_term-bug/OTP-15080
Fix bug in enif_binary_to_term for immediates
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r-- | erts/emulator/beam/erl_nif.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index e208792868..0fbf0eb03a 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -1255,8 +1255,10 @@ size_t enif_binary_to_term(ErlNifEnv *dst_env, if (is_non_value(*term)) { return 0; } - erts_factory_close(&factory); - cache_env(dst_env); + if (size > 0) { + erts_factory_close(&factory); + cache_env(dst_env); + } ASSERT(bp > data); return bp - data; |