aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_info.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2019-03-28 19:59:58 +0100
committerRickard Green <[email protected]>2019-04-05 14:50:27 +0200
commitf2671c2ef47f8c49cd5fab6e1737ed08d99ea5d2 (patch)
treeaa69869ff75dadbcdf8c3432ec370c7af409d844 /erts/emulator/beam/erl_bif_info.c
parent060d9110ffb305d6ce5f974788948463e481203b (diff)
downloadotp-f2671c2ef47f8c49cd5fab6e1737ed08d99ea5d2.tar.gz
otp-f2671c2ef47f8c49cd5fab6e1737ed08d99ea5d2.tar.bz2
otp-f2671c2ef47f8c49cd5fab6e1737ed08d99ea5d2.zip
Fail when we cannot encode term in binary
Fail when we cannot encode term in binary instead of producing a faulty result.
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rw-r--r--erts/emulator/beam/erl_bif_info.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index a7424bbcb8..d542848460 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -4235,7 +4235,10 @@ BIF_RETTYPE erts_debug_get_internal_state_1(BIF_ALIST_1)
Uint dflags = (TERM_TO_BINARY_DFLAGS
& ~DFLAG_EXPORT_PTR_TAG
& ~DFLAG_BIT_BINARIES);
- BIF_RET(erts_term_to_binary(BIF_P, tp[2], 0, dflags));
+ Eterm res = erts_term_to_binary(BIF_P, tp[2], 0, dflags);
+ if (is_value(res))
+ BIF_RET(res);
+ BIF_ERROR(BIF_P, SYSTEM_LIMIT);
}
else if (ERTS_IS_ATOM_STR("dist_ctrl", tp[1])) {
Eterm res = am_undefined;