diff options
author | Erlang/OTP <[email protected]> | 2018-06-05 11:57:21 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2018-06-05 11:57:21 +0200 |
commit | 3d57a62f8ed1ee95096fbba68f179dc33f2b4dbd (patch) | |
tree | 7be47838f9b815128d1beabec08cc6c8a2b36a1c /erts/emulator/beam | |
parent | 40ab3958644be3fc14682c54233514fdf880386a (diff) | |
parent | d7bacbc798d608f259eb2faaaf194cb9df323018 (diff) | |
download | otp-3d57a62f8ed1ee95096fbba68f179dc33f2b4dbd.tar.gz otp-3d57a62f8ed1ee95096fbba68f179dc33f2b4dbd.tar.bz2 otp-3d57a62f8ed1ee95096fbba68f179dc33f2b4dbd.zip |
Merge branch 'sverker/enif_binary_to_term-bug/OTP-15080' into maint-20
* sverker/enif_binary_to_term-bug/OTP-15080:
erts: Fix bug in enif_binary_to_term for immediates
Diffstat (limited to 'erts/emulator/beam')
-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 b96db5d054..4e479c26ef 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -1251,8 +1251,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; |