diff options
author | Sverker Eriksson <[email protected]> | 2017-02-14 18:26:31 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-02-14 18:26:31 +0100 |
commit | 118de47d703e303aea7f4575849a37c11416ba14 (patch) | |
tree | 211bbb6c24d6069c657d3b7ac7776be45631ec48 /erts/emulator/beam/dist.c | |
parent | dd60ebfa1f2f6dc203deee59f95305291d06a619 (diff) | |
download | otp-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/dist.c')
-rw-r--r-- | erts/emulator/beam/dist.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index 390f2a0db3..da1083100b 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -713,7 +713,7 @@ static void clear_dist_entry(DistEntry *dep) } } -void erts_dsend_context_dtor(Binary* ctx_bin) +int erts_dsend_context_dtor(Binary* ctx_bin) { ErtsSendContext* ctx = ERTS_MAGIC_BIN_DATA(ctx_bin); switch (ctx->dss.phase) { @@ -730,6 +730,8 @@ void erts_dsend_context_dtor(Binary* ctx_bin) } if (ctx->dep_to_deref) erts_deref_dist_entry(ctx->dep_to_deref); + + return 1; } Eterm erts_dsend_export_trap_context(Process* p, ErtsSendContext* ctx) |