aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_ptab.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-02-14 18:26:31 +0100
committerSverker Eriksson <[email protected]>2017-02-14 18:26:31 +0100
commit118de47d703e303aea7f4575849a37c11416ba14 (patch)
tree211bbb6c24d6069c657d3b7ac7776be45631ec48 /erts/emulator/beam/erl_ptab.c
parentdd60ebfa1f2f6dc203deee59f95305291d06a619 (diff)
downloadotp-118de47d703e303aea7f4575849a37c11416ba14.tar.gz
otp-118de47d703e303aea7f4575849a37c11416ba14.tar.bz2
otp-118de47d703e303aea7f4575849a37c11416ba14.zip
erts: Add deallocation veto for magic destructors
A magic destructor can return 0 and thereby take control and prolong the lifetime of a magic binary.
Diffstat (limited to 'erts/emulator/beam/erl_ptab.c')
-rw-r--r--erts/emulator/beam/erl_ptab.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_ptab.c b/erts/emulator/beam/erl_ptab.c
index a132b1d334..ce28708ece 100644
--- a/erts/emulator/beam/erl_ptab.c
+++ b/erts/emulator/beam/erl_ptab.c
@@ -733,7 +733,7 @@ erts_ptab_delete_element(ErtsPTab *ptab,
* erts_ptab_list() implements BIFs listing the content of the table,
* e.g. erlang:processes/0.
*/
-static void cleanup_ptab_list_bif_data(Binary *bp);
+static int cleanup_ptab_list_bif_data(Binary *bp);
static int ptab_list_bif_engine(Process *c_p, Eterm *res_accp, Binary *mbp);
@@ -787,7 +787,7 @@ erts_ptab_list(Process *c_p, ErtsPTab *ptab)
return ret_val;
}
-static void
+static int
cleanup_ptab_list_bif_data(Binary *bp)
{
ErtsPTabListBifData *ptlbdp = ERTS_MAGIC_BIN_DATA(bp);
@@ -875,6 +875,8 @@ cleanup_ptab_list_bif_data(Binary *bp)
ERTS_PTAB_LIST_DBG_TRACE(ptlbdp->debug.caller, return);
ERTS_PTAB_LIST_DBG_CLEANUP(ptlbdp);
+
+ return 1;
}
static int